public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13527] New: __attribute__ ((unused)) ignored
@ 2003-12-31  2:35 robin at robindaugherty dot net
  2003-12-31  2:39 ` [Bug c++/13527] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: robin at robindaugherty dot net @ 2003-12-31  2:35 UTC (permalink / raw)
  To: gcc-bugs

In a number of seperate files, the ((unused)) attribute went ignored, causing
warnings for these lines:

static char bugs_doc[] __attribute__ ((unused)) = "Robin Daugherty";
static char version[] __attribute__ ((unused)) = "hsmdr 1.0 (2003-APR-29)";

But only if the mysql header files are included first:

// MySQL client headers
#include <mysql/my_global.h>
#include <mysql/my_sys.h>
#include <mysql/m_string.h>
#include <mysql/mysql.h>
#include <mysql/mysql_embed.h>
#include <mysql/errmsg.h>
#include <mysql/my_getopt.h>

Moving this block before the two declarations causes warnings to be issued:

hsmdr.cpp:48: warning: `char bugs_doc[16]' defined but not used
hsmdr.cpp:49: warning: `char version[24]' defined but not used

But these warnings are gone if the declaration is first.

-- 
           Summary: __attribute__ ((unused)) ignored
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: robin at robindaugherty dot net
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13527


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/13527] __attribute__ ((unused)) ignored
  2003-12-31  2:35 [Bug c++/13527] New: __attribute__ ((unused)) ignored robin at robindaugherty dot net
@ 2003-12-31  2:39 ` pinskia at gcc dot gnu dot org
  2003-12-31 16:06 ` robin at robindaugherty dot net
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-31  2:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-30 22:54 -------
Can you provide the preprocessed source file after reading http://gcc.gnu.org/bugs.html.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13527


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/13527] __attribute__ ((unused)) ignored
  2003-12-31  2:35 [Bug c++/13527] New: __attribute__ ((unused)) ignored robin at robindaugherty dot net
  2003-12-31  2:39 ` [Bug c++/13527] " pinskia at gcc dot gnu dot org
@ 2003-12-31 16:06 ` robin at robindaugherty dot net
  2003-12-31 17:00 ` falk at debian dot org
  2004-02-17 23:03 ` Jeremy at Zawodny dot com
  3 siblings, 0 replies; 5+ messages in thread
From: robin at robindaugherty dot net @ 2003-12-31 16:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From robin at robindaugherty dot net  2003-12-31 15:10 -------
I have observed this with 3.2.1 and 3.3.2 (made with default options for x86 on
Linux).  I compile these files with -Wall (I use this option in my Makefiles).

I have attached two files, one which causes five warnings, and one which causes
only three.  The difference between them is that #include <mysql/my_global.h> is
before the definitions in the first file, but after them in the second.

Let me know if you still want preprocessed sources from me.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13527


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/13527] __attribute__ ((unused)) ignored
  2003-12-31  2:35 [Bug c++/13527] New: __attribute__ ((unused)) ignored robin at robindaugherty dot net
  2003-12-31  2:39 ` [Bug c++/13527] " pinskia at gcc dot gnu dot org
  2003-12-31 16:06 ` robin at robindaugherty dot net
@ 2003-12-31 17:00 ` falk at debian dot org
  2004-02-17 23:03 ` Jeremy at Zawodny dot com
  3 siblings, 0 replies; 5+ messages in thread
From: falk at debian dot org @ 2003-12-31 17:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From falk at debian dot org  2003-12-31 15:41 -------
#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__)  ||
__GNUC__ == 2 && __GNUC_MINOR__ < 8)
#define __attribute__(A)
#endif

There's the cuplrit. Complain to whoever provided this header file.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13527


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/13527] __attribute__ ((unused)) ignored
  2003-12-31  2:35 [Bug c++/13527] New: __attribute__ ((unused)) ignored robin at robindaugherty dot net
                   ` (2 preceding siblings ...)
  2003-12-31 17:00 ` falk at debian dot org
@ 2004-02-17 23:03 ` Jeremy at Zawodny dot com
  3 siblings, 0 replies; 5+ messages in thread
From: Jeremy at Zawodny dot com @ 2004-02-17 23:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Jeremy at Zawodny dot com  2004-02-17 23:03 -------
I made sure this got into MySQL AB's bug tracking system:

http://bugs.mysql.com/bug.php?id=2717

Jeremy

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13527


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-02-17 23:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-31  2:35 [Bug c++/13527] New: __attribute__ ((unused)) ignored robin at robindaugherty dot net
2003-12-31  2:39 ` [Bug c++/13527] " pinskia at gcc dot gnu dot org
2003-12-31 16:06 ` robin at robindaugherty dot net
2003-12-31 17:00 ` falk at debian dot org
2004-02-17 23:03 ` Jeremy at Zawodny dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).