Unused argument during compilation

Hi,

When I compile stuff with clang, I get a lot of noise in the output saying 'unused argument during compilation'. This is because various layers of makefiles add things to the CFLAGS without checking whether they are already there. If you specify -O2 twice, for example, clang will give you a misleading warning that -O2 is unused - in fact, it is used, but it's only used once. The same is true for various other directives.

Is it possible to suppress this, and only warn about options that really aren't used, rather than ones that are specified more times than they are used?

David

Doesn't it have a [-Wfoo] option specified? This means you can pass -Wno-foo to turn this warning off.

Hi,

When I compile stuff with clang, I get a lot of noise in the output saying 'unused argument during compilation'. This is because various layers of makefiles add things to the CFLAGS without checking whether they are already there. If you specify -O2 twice, for example, clang will give you a misleading warning that -O2 is unused - in fact, it is used, but it's only used once. The same is true for various other directives.

Is it possible to suppress this, and only warn about options that really aren't used, rather than ones that are specified more times than they are used?

I think it is possible. If I recall correctly, the many -g* options
are doing the right thing now.

David

Cheers,

You can turn off the unused argument warning in general, but then you won't get a warning when you pass an argument that is wrong for this compilation phase, or which clang doesn't understand.

David

-- Sent from my Difference Engine