Hi ! help please

Jonathan Wakely jwakely.gcc@gmail.com
Sat Jan 2 13:04:00 GMT 2016


On 2 January 2016 at 12:39, Jonathan Wakely <jwakely.gcc@gmail.com> 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.



More information about the Gcc-help mailing list