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

            Bug ID: 58138
           Summary: #include <random> gives warning: macro
                    "__code_model_small__" is not used
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sbergman at redhat dot com

At least with a trunk revision 201654 (aka LATEST-4.9) build (on Fedora 18
x86_64):

> $ cat test1.cc
> #include <random>
> namespace {}

> $ ~/gcc/LATEST-4.9/inst/bin/g++ -std=gnu++11 -Wunused-macros -c test1.cc
> test1.cc:2:12: warning: macro "__code_model_small__" is not used 
> [-Wunused-macros]
>  namespace {}
>             ^

I was able to strip that down to the following excerpt of
~/gcc/LATEST-4.9/inst/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/include/ia32intrin.h:

> $ cat test2.cc
> #include "test2.h"
> namespace {}

> $ cat test2.h
> #pragma GCC system_header
> #pragma GCC push_options
> #pragma GCC target("sse4.2")
> #pragma GCC pop_options

> $ ~/gcc/LATEST-4.9/inst/bin/g++ -Wunused-macros -c test2.cc test2.cc:2:12: 
> warning: macro "__code_model_small__" is not used [-Wunused-macros]
>  namespace {}
>             ^

With a build of tags/gcc_4_8_1_release, compiling test1.cc does not give a
warning while test2.cc does.  And with a random old build of
branches/gcc-4_6-branch, compiling neither test1.cc nor test2.cc gives a
warning (replacing -std=gnu++11 with -std=gnu++0x when compiling test1.cc).

Reply via email to