public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/28199]  New: -Wmissing-format-attribute produces false positives on vprintf() like functions
@ 2006-06-29 11:27 flameeyes at gentoo dot org
  2006-06-29 11:42 ` [Bug c/28199] " flameeyes at gentoo dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: flameeyes at gentoo dot org @ 2006-06-29 11:27 UTC (permalink / raw)
  To: gcc-bugs

As the summary says, -Wmissing-format-attribute produces false positive
warnings when a function is declared to use a vprintf-like prototype, and this
can't be fixed because the printf attribute does not support varargs functions
(of course).

I'm attaching a testcase that should identify the problem. I hope it's in the
right format, I don't follow development closely, so I just adapted a testcase
from Joseph S. Myers that was added with the fix to bug #1017.

HTH,
Diego


-- 
           Summary: -Wmissing-format-attribute produces false positives on
                    vprintf() like functions
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: flameeyes at gentoo dot org
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

* [Bug c/28199] -Wmissing-format-attribute produces false positives on vprintf() like functions
  2006-06-29 11:27 [Bug c/28199] New: -Wmissing-format-attribute produces false positives on vprintf() like functions flameeyes at gentoo dot org
@ 2006-06-29 11:42 ` flameeyes at gentoo dot org
  2006-06-29 11:49 ` schwab at suse dot de
  2006-06-29 12:46 ` flameeyes at gentoo dot org
  2 siblings, 0 replies; 4+ messages in thread
From: flameeyes at gentoo dot org @ 2006-06-29 11:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from flameeyes at gentoo dot org  2006-06-29 11:27 -------
Created an attachment (id=11780)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11780&action=view)
impossible-missing-format-attribute.c


-- 


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


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

* [Bug c/28199] -Wmissing-format-attribute produces false positives on vprintf() like functions
  2006-06-29 11:27 [Bug c/28199] New: -Wmissing-format-attribute produces false positives on vprintf() like functions flameeyes at gentoo dot org
  2006-06-29 11:42 ` [Bug c/28199] " flameeyes at gentoo dot org
@ 2006-06-29 11:49 ` schwab at suse dot de
  2006-06-29 12:46 ` flameeyes at gentoo dot org
  2 siblings, 0 replies; 4+ messages in thread
From: schwab at suse dot de @ 2006-06-29 11:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from schwab at suse dot de  2006-06-29 11:42 -------
>From (gcc)Function Attributes:
     For functions where the
     arguments are not available to be checked (such as `vprintf'),
     specify the third parameter as zero.

void foo (const char *, va_list) __attribute__ ((format (printf, 1, 0)));


-- 

schwab at suse dot de changed:

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


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


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

* [Bug c/28199] -Wmissing-format-attribute produces false positives on vprintf() like functions
  2006-06-29 11:27 [Bug c/28199] New: -Wmissing-format-attribute produces false positives on vprintf() like functions flameeyes at gentoo dot org
  2006-06-29 11:42 ` [Bug c/28199] " flameeyes at gentoo dot org
  2006-06-29 11:49 ` schwab at suse dot de
@ 2006-06-29 12:46 ` flameeyes at gentoo dot org
  2 siblings, 0 replies; 4+ messages in thread
From: flameeyes at gentoo dot org @ 2006-06-29 12:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from flameeyes at gentoo dot org  2006-06-29 12:17 -------
Sorry, I think I misunderstood the error messages' chain, as when the
__attribute__ is malformed (forgot a '('), the warning about the possible
candidate appear anyway, so i thought it was simply being ignored with '0'
parameter.

Sorry :(


-- 


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


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

end of thread, other threads:[~2006-06-29 12:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-29 11:27 [Bug c/28199] New: -Wmissing-format-attribute produces false positives on vprintf() like functions flameeyes at gentoo dot org
2006-06-29 11:42 ` [Bug c/28199] " flameeyes at gentoo dot org
2006-06-29 11:49 ` schwab at suse dot de
2006-06-29 12:46 ` flameeyes at gentoo dot org

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).