This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug objc/53905] New: -Wformat-nonliteral gives false positives with __attribute__((format(NSString,...)))


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

             Bug #: 53905
           Summary: -Wformat-nonliteral gives false positives with
                    __attribute__((format(NSString,...)))
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: objc
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: naesten@gmail.com


iMac:hacking user$ gcc-fsf-4.7 --version
gcc-fsf-4.7 (GCC) 4.7.1
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

iMac:hacking user$ cat NSString_format_bug.
NSString_format_bug.m   NSString_format_bug.m~  NSString_format_bug.o
iMac:hacking user$ cat NSString_format_bug.m

#pragma GCC diagnostic error "-Wformat"
#pragma GCC diagnostic error "-Wformat-nonliteral"

@class NSString;

extern void NSLog(NSString *, ...) __attribute__((format(NSString, 1, 2)));

void foo ()
{
  NSLog(@"Hi!");
}
iMac:hacking user$ gcc-fsf-4.7 -c NSString_format_bug.m
NSString_format_bug.m: In function âfooâ:
NSString_format_bug.m:11:3: error: format not a string literal and no format
arguments [-Werror=format-nonliteral]
cc1obj: some warnings being treated as errors


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]