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]
Other format: [Raw text]

Re: Go in gcc 4.7


Andreas Schwab <schwab@linux-m68k.org> writes:

> Dennis Clarke <dclarke@blastwave.org> writes:
>
>> 	for (argno = 0; argno < argc; argno++) {
>> 		if (argno < 6)
>> 			*tsp++ = reg[REG_O0 + argno] = va_arg(ap, long);
>> 		else
>> 			*tsp++ = va_arg(ap, long);
>
> This is broken.  The arguments are of type int, not long.

I suspect that the error of using "int" is one of the reasons why
makecontext has been removed from POSIX.  Thought I don't know why it
was not replaced with a proper version.

In this case, where the arguments are passed via registers anyhow, using
long rather than int will always work for int, and will additionally
work for void*, so using long is a good practical choice: it will work
for correct code, and will make incorrect code which uses pointers more
likely to work.

Ian


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