Re: Hi ! help please

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

 



On 2 January 2016 at 12:39, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote:
> On 1 January 2016 at 15:04, user user wrote:
>> Hi ! help please
>> if((result=f())==0)
>> is Undefined behavior ?
>
> This question is not appropriate on this mailing list, because it's
> not about GCC. Please find somewhere more appropriate for general C
> programming questions, such as http://stackoverflow.com
>
> In general, no, it's not undefined behaviour (why would it be?).
> However if f() modifies result (e.g. because it's a global variable)
> then it is undefined.

Gah, I confused myself, even if result is modified it's still not
undefined, because the function returns before the assignment.



[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