This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/58709] New: [c++11] Bogus? int vs. scoped enum printf warning when -fabi-version >= 6
- From: "ppluzhnikov at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 13 Oct 2013 00:08:07 +0000
- Subject: [Bug c++/58709] New: [c++11] Bogus? int vs. scoped enum printf warning when -fabi-version >= 6
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58709
Bug ID: 58709
Summary: [c++11] Bogus? int vs. scoped enum printf warning when
-fabi-version >= 6
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ppluzhnikov at google dot com
Test:
#include <stdio.h>
enum class Foo {
FOO
};
int main()
{
printf("%d\n", Foo::FOO);
}
Using "g++ (GCC) 4.9.0 20131005 (experimental)":
$ g++ -c -std=c++11 -Wformat t.cc
$
$ g++ -c -std=c++11 -Wformat t.cc -fabi-version=6
t.cc:9:26: warning: format â%dâ expects argument of type âintâ, but argument 2
has type âFooâ [-Wformat=]
printf("%d\n", Foo::FOO);
^
From gcc/common.opt:
; 6: The version of the ABI that doesn't promote scoped enums to int and ...
This seems like a bug -- even though the scoped enum is not promoted to an int,
printf warning doesn't seem appropriate here either.