This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

__builtin_return_address why const parameter ?



why am I forced to write clumsy code like this:

  void* bra = 0;
  switch (level) {
    case 1: bra = __builtin_return_address(1); break;
    case 2: bra = __builtin_return_address(2); break;
    case 3: bra = __builtin_return_address(3); break;
    case 4: bra = __builtin_return_address(4); break;
    default: ;
  }
  return bra;


instead of:

     return __builtin_return_address(level);

in other words, why does __builtin_return_address() insist on a 
integer constant as parameter?
-- 
	-lauther

----------------------------------------------------------------------------
Ulrich Lauther          ph: +49 89 636 48834 fx: ... 636 42284
Siemens ZT SE 4         Internet: Ulrich.Lauther@mchp.siemens.de

-- 
	-lauther

----------------------------------------------------------------------------
Ulrich Lauther          ph: +49 89 636 48834 fx: ... 636 42284
Siemens ZT SE 4         Internet: Ulrich.Lauther@mchp.siemens.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]