Re: www.gnu.org/software/gcc/bugs/#nonbugs_c (with ++ / --)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> Nothing defined
>> implementation of the passage of a function settings. But it turns out that
>> in the case of gcc, they are pushed onto the stack from right to left.
>
>I think it depends on the hardware architecture.
>
>> As it
>> has been since the dawn of time in Savannah, it is definitely impossible to
>> change this state of affairs in gnou. Thus be it!
>>
>>     So my question is: reverse the order of parameters (shock me, but) make
>> functional! What about you? Portability?
>
>I don't understand the question.

He probably means that if he reverses the argument order (like a+=1, b, a) then
he'd get the desired result. But as you mentioned it probably depends on the
hardware and compiler so it is not portable.

I'd say this is undefined behaviour and could be solved like
c=a;
foo(c, b, a+=1);        // order of evaluation not important

bye  Fabi





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux