Unused argument during compilation

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Unused argument during compilation

David Chisnall-2
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

--
This email complies with ISO 3103


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Unused argument during compilation

Chris Lattner

On May 19, 2010, at 5:24 AM, David Chisnall wrote:

> 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?  

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


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Unused argument during compilation

Rafael Espindola
In reply to this post by David Chisnall-2
On 19 May 2010 08:24, David Chisnall <[hidden email]> wrote:
> 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,
--
Rafael Ávila de Espíndola

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Unused argument during compilation

David Chisnall-2
In reply to this post by Chris Lattner
On 19 May 2010, at 19:35, Chris Lattner wrote:

> On May 19, 2010, at 5:24 AM, David Chisnall wrote:
>
>> 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?  
>
> Doesn't it have a [-Wfoo] option specified?  This means you can pass -Wno-foo to turn this warning off.


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

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev