This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Does it safe to link several objects which compiled with different `--std` flags ?
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Remus Clearwater <remus dot clearwater at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Fri, 8 Jun 2018 13:18:30 +0100
- Subject: Re: Does it safe to link several objects which compiled with different `--std` flags ?
- References: <CAMjELSv21mKabnLnt+y5K7ftwAfOGT=BD6EsDLfLZssnioqckw@mail.gmail.com>
On 8 June 2018 at 13:17, Remus Clearwater wrote:
> For example:
>
> $ gcc -c --std=gnu90 a.c -o a.o
> $ gcc -c --std=gnu11 b.c -o b.o
> $ gcc -c --std=c99 c.c -o c.o
> $ ld -o bin /lib/crt0.o a.o b.o c.o -lc
>
> I think the answer should be 'true' but I couldn't find any specification
> about it yet.
See the thread starting at https://gcc.gnu.org/ml/gcc-help/2018-05/msg00034.html