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

Re: gcc-6 fails to compile a valid code



Hi Robert,



>Actually it was me, who posted the code. I've just seen your e-mail
>after the issue was re-assigned back to ucl.


oops, sorry!

>I can still reproduce the issue on i386, but I guess you use amd64. In


true, indeed

>such a case you need to replace `4' with `8' (the value `4' was expanded>from sizeof(long) by the macro included at the bottom of my previous
>e-mail):


oops, sure

>(experimental_amd64-dchroot)robert@barriere:~$ gcc-5 ./test.c
>/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In
>function `_start':
>(.text+0x20): undefined reference to `main'


you need a -c there :)

>
>I've  found quite similar gcc bug
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55009
>
>The reasoning given there suggests that you are right, and this is not
>gcc bug, as the expression 1l << 63 on amd64 or 1l << 31 on i386
>involves undefined behaviour.
>
>I'll try to fix the issue at ucl side by switching to _Static_assert.


not sure, feel free to investigate more :)
thanks for the heads up!

cheers,

Gianfranco


Reply to: