Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#2414 closed Patches (invalid)

Fix for "defined but not used" warning

Reported by: Dave Abrahams Owned by: Douglas Gregor
Milestone: Boost 1.37.0 Component: graph
Version: Boost 1.36.0 Severity: Cosmetic
Keywords: Cc:

Description

The following simple patch seems to make GCC a whole lot happier:

  • properties.hpp

     
    9393#else
    9494#define BOOST_DEF_PROPERTY(KIND, NAME) \
    9595  struct KIND##_##NAME##_t {};                          \
    96   namespace { KIND##_##NAME##_t KIND##_##NAME; }        \
     96  namespace { KIND##_##NAME##_t const KIND##_##NAME = {}; }   \
    9797  BOOST_INSTALL_PROPERTY(KIND, NAME)
    9898#endif
    9999

I haven't tested it against the trunk tests but if you are willing to try and see what breaks, I would be happy to apply it in trunk if you give me the go-ahead.

Change History (4)

comment:1 by Douglas Gregor, 14 years ago

Please go ahead and apply to the trunk

comment:2 by Dave Abrahams, 14 years ago

Resolution: invalid
Status: newclosed

Turns out the trunk avoids this problem by using enums.

comment:3 by leyisong@…, 12 years ago

I also meet a prooblem just like "defined but not used" warning..... It drives me mad~

in reply to:  3 comment:4 by Steven Watanabe, 12 years ago

Replying to leyisong@…:

I also meet a prooblem just like "defined but not used" warning..... It drives me mad~

This comment is somewhat pointless unless you can be more specific.

Note: See TracTickets for help on using tickets.