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 c++/46024] New: g++.dg/warn/miss-format-1.C FAILs on Solaris 8 and 9


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

           Summary: g++.dg/warn/miss-format-1.C FAILs on Solaris 8 and 9
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ro@gcc.gnu.org
              Host: i386-pc-solaris2.[89], sparc-sun-solaris2.8
            Target: i386-pc-solaris2.[89], sparc-sun-solaris2.8
             Build: i386-pc-solaris2.[89], sparc-sun-solaris2.8


Created attachment 22043
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22043
preprocessed input (from Solaris 8/x86) for miss-format-1.C

The g++.dg/warn/miss-format-1.C FAILs on both Solaris 8 and 9/x86 and
Solaris 8/SPARC, but not on Solaris 9/SPARC:

i386-pc-solaris2.8:

FAIL: g++.dg/warn/miss-format-1.C printf attribute warning (test for warnings,
line 17)
FAIL: g++.dg/warn/miss-format-1.C printf attribute warning 2 (test for
warnings, line 42)
FAIL: g++.dg/warn/miss-format-1.C (test for excess errors)

Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/warn/miss-format-1.C:26:18:
error: 'vscanf' was not declared in this scope

i386-pc-solaris2.9:

FAIL: g++.dg/warn/miss-format-1.C printf attribute warning (test for warnings,
line 17)
FAIL: g++.dg/warn/miss-format-1.C printf attribute warning 2 (test for
warnings, line 42)

sparc-sun-solaris2.8:

FAIL: g++.dg/warn/miss-format-1.C (test for excess errors)

Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/warn/miss-format-1.C:26:18:
error: 'vscanf' was not declared in this scope

It seems strange to get that excess error even though there's a dg-error
covering exactly that situation.

But what's even more strange is that the Solaris 8 and 9/x86 compilers don't
warn for lines 17 and 42 for exactly the same preprocessed input that the
Solaris 8/SPARC compiler warns about:

s8sparc% gcc -Wmissing-format-attribute -S miss-format-1.ii
miss-format-1.ii: In function 'void foo(const char*, ...)':
miss-format-1.ii:123:19: warning: function might be possible candidate for
'gnu_printf' format attribute [-Wmissing-format-attribute]
miss-format-1.ii: In function 'void bar(const char*, ...)':
miss-format-1.ii:131:18: error: 'vscanf' was not declared in this scope
miss-format-1.ii: In function 'void vfoo(const char*, va_list)':
miss-format-1.ii:145:20: warning: function might be possible candidate for
'gnu_printf' format attribute [-Wmissing-format-attribute]
s9x86% gcc -Wmissing-format-attribute -S miss-format-1.ii
miss-format-1.s8x86.ii: In function 'void bar(const char*, ...)':
miss-format-1.s8x86.ii:131:18: error: 'vscanf' was not declared in this scope

I'd have expected such a warning to be target-independent.


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