Clang warning verbosity issue/question

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

Clang warning verbosity issue/question

Romain Pechayre
Hello all, 

I've been using clang for a few days to build c++ code at work, and I really enjoy it !
I am almost ready to drop my gcc build config (debug), but I am having a lot of warning !

As I am manually passing path to the right includes using -I/path-to-stl-headers, I get a few warning on stl headers that are repeated again and again.For example, I get a warning for some template specialisations saying that a struct is already declared whereas it is a template specialisation. 
Is this something expected ? Can I fix it by hardcoding the path as explained on clang website ? 

In addition to that, I get a lot of warning from boost macros, since clang is telling me that an argument (say "weights") is unused, whereas it is actually used as part of the name of a struct. So I was wondering it these warnings where real ones or it there was something wrong ...

The result of this is that it is difficult for me to use clang as I cannot see my own warnings lost in a list of 1000 warnings from the headers I am including. 

Kind regards,
Romain

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

Re: Clang warning verbosity issue/question

Douglas Gregor

On Sep 3, 2010, at 8:15 AM, Romain Pechayre wrote:

> Hello all,
>
> I've been using clang for a few days to build c++ code at work, and I really enjoy it !
> I am almost ready to drop my gcc build config (debug), but I am having a lot of warning !
>
> As I am manually passing path to the right includes using -I/path-to-stl-headers, I get a few warning on stl headers that are repeated again and again.For example, I get a warning for some template specialisations saying that a struct is already declared whereas it is a template specialisation.
> Is this something expected ? Can I fix it by hardcoding the path as explained on clang website ?
>

You can use -isystem instead of -I.

> In addition to that, I get a lot of warning from boost macros, since clang is telling me that an argument (say "weights") is unused, whereas it is actually used as part of the name of a struct. So I was wondering it these warnings where real ones or it there was something wrong ...

Can you show us the specific warning that you're seeing?

        - Doug


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

Re: Clang warning verbosity issue/question

Romain Pechayre
Sure,

Here is an warning example I have from boost headers:
[some path]/boost/accumulators/accumulators.hpp:21:
[some_other_path]/boost/accumulators/framework/parameters/weights.hpp:17:1: warning: unused variable 'weights' [-Wunused-variable]
BOOST_PARAMETER_KEYWORD(tag, weights)
                                                            ^
I am using boost 1_43 and working on a very recent svn build of clang (less than 3 days old). 
Please let me know if I can give any additional information

Romain


On Fri, Sep 3, 2010 at 5:57 PM, Douglas Gregor <[hidden email]> wrote:

On Sep 3, 2010, at 8:15 AM, Romain Pechayre wrote:

> Hello all,
>
> I've been using clang for a few days to build c++ code at work, and I really enjoy it !
> I am almost ready to drop my gcc build config (debug), but I am having a lot of warning !
>
> As I am manually passing path to the right includes using -I/path-to-stl-headers, I get a few warning on stl headers that are repeated again and again.For example, I get a warning for some template specialisations saying that a struct is already declared whereas it is a template specialisation.
> Is this something expected ? Can I fix it by hardcoding the path as explained on clang website ?
>

You can use -isystem instead of -I.

> In addition to that, I get a lot of warning from boost macros, since clang is telling me that an argument (say "weights") is unused, whereas it is actually used as part of the name of a struct. So I was wondering it these warnings where real ones or it there was something wrong ...

Can you show us the specific warning that you're seeing?

       - Doug



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

Re: Clang warning verbosity issue/question

Douglas Gregor


Sent from my iPhone

On Sep 6, 2010, at 1:22 AM, Romain Pechayre <[hidden email]> wrote:

Sure,

Here is an warning example I have from boost headers:
[some path]/boost/accumulators/accumulators.hpp:21:
[some_other_path]/boost/accumulators/framework/parameters/weights.hpp:17:1: warning: unused variable 'weights' [-Wunused-variable]
BOOST_PARAMETER_KEYWORD(tag, weights)
                                                            ^
I am using boost 1_43 and working on a very recent svn build of clang (less than 3 days old). 
Please let me know if I can give any additional information

Clang is doing something reasonable here, IMO. BOOST_PARAMETER_KEYWORD should have the unused attribute on it. 

  - Doug

Romain


On Fri, Sep 3, 2010 at 5:57 PM, Douglas Gregor <[hidden email]> wrote:

On Sep 3, 2010, at 8:15 AM, Romain Pechayre wrote:

> Hello all,
>
> I've been using clang for a few days to build c++ code at work, and I really enjoy it !
> I am almost ready to drop my gcc build config (debug), but I am having a lot of warning !
>
> As I am manually passing path to the right includes using -I/path-to-stl-headers, I get a few warning on stl headers that are repeated again and again.For example, I get a warning for some template specialisations saying that a struct is already declared whereas it is a template specialisation.
> Is this something expected ? Can I fix it by hardcoding the path as explained on clang website ?
>

You can use -isystem instead of -I.

> In addition to that, I get a lot of warning from boost macros, since clang is telling me that an argument (say "weights") is unused, whereas it is actually used as part of the name of a struct. So I was wondering it these warnings where real ones or it there was something wrong ...

Can you show us the specific warning that you're seeing?

       - Doug



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