[PATCH] D17998: [ELF] implement --warn-common/--no-warn-common

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 13 00:08:47 PST 2016


On Sat, Mar 12, 2016 at 11:46:12PM -0800, Rui Ueyama via llvm-commits wrote:
> On Sat, Mar 12, 2016 at 11:27 PM, Joerg Sonnenberger <
> joerg at britannica.bec.de> wrote:
> 
> > On Sat, Mar 12, 2016 at 06:42:38PM -0800, Rui Ueyama wrote:
> > > Looking into it and I found that this patch seems desirable. I think the
> > > use case of this option is to catch any programmer's error to forget to
> > add
> > > "extern" to uninitialized global variables. They are usually silently
> > > merged by the linker because they are common symbols, but you often want
> > to
> > > avoid that default behavior and do rigorous error checking. This option
> > is
> > > useful for that. In that case you want to find any common duplicate
> > common
> > > symbols regardless of their sizes.
> >
> > But that's already better served by -fno-common in the compiler.
> >
> 
> In that sense this linker option is redundant, no?

It is exactly still useful for dealing with Fortran :)

Joerg


More information about the llvm-commits mailing list