title: clang ignores -std=c++11 flag for include files
body: <p>I have some code that I use a (old) Mersenne Twister header file with to get a good pseudo-random number generator.</p>
  <p>The problem is that that code uses the <code>register</code> keyword which (as far as I understand) was deprecated in <code>c++11</code> and throws an error with <code>c++17</code>. I believe I am using the latter in the version of <code>clang</code> I'm using on Mac OSX (10.14.6; Mojave).</p>
  <p>The Makefile I am using is as thus:</p>
  <pre><code>BUILDDIR=$(TOPDIR)/bin
  INCDIROUT=$(BUILDDIR)/include
  LIBDIROUT=$(BUILDDIR)/lib
  INCDIR=inc/
  SRCDIR=src/
  INCFLAG= -IMersenne -Iinc
  LIBFLAG= -L. -L$(LIBDIROUT)
  
  #need to use an older version of gcc b/c of Mersenne Twister using the deprecated `register` keyword
  #https://github.com/danini/graph-cut-ransac/issues/23
  CXX=clang++
  #CXXFLAGS=-g -std=c++11 -Wall -pedantic
  CXXFLAGS=-fpermissive -std=c++98
  
  #trick for getting the git version in the code
  GIT_VERSION = $(shell sh -c 'git describe --abbrev=4 --always')
  
  CFLAGS += -D__GIT_VERSION=\&quot;$(GIT_VERSION)\&quot;
  
  RUN_SCRIPT := $(shell mkdir -p 'bin/lib')
  
  all: $(BUILDDIR)/realizeCascades $(LIBDIROUT)/rootUtil.o $(LIBDIROUT)/edepmath.o $(LIBDIROUT)/cascadeProd.o $(LIBDIROUT)/isotope_info.o $(LIBDIROUT)/weisskopf.o $(LIBDIROUT)/lindhard.o $(LIBDIROUT)/libncap.so
  
  $(LIBDIROUT)/isotope_info.o: $(SRCDIR)/isotope_info.c $(INCDIR)/isotope_info.h
          $(CXX) -std=c++98 -fPIC -c $(CFLAGS) $(INCFLAG) $(SRCDIR)/isotope_info.c `root-config --cflags --glibs` $(LIBFLAG) 
          mv isotope_info.o $(LIBDIROUT)/
  
  $(LIBDIROUT)/rootUtil.o: $(SRCDIR)/rootUtil.c $(INCDIR)/rootUtil.h
          $(CXX) -std=c++98 -fPIC -c $(CFLAGS) $(INCFLAG) $(SRCDIR)/rootUtil.c `root-config --cflags --glibs` $(LIBFLAG) 
          mv rootUtil.o $(LIBDIROUT)/
  
  $(LIBDIROUT)/edepmath.o: $(SRCDIR)/edepmath.c $(INCDIR)/edepmath.h
          $(CXX) -std=c++98 -fPIC -c $(CFLAGS) $(INCFLAG) $(SRCDIR)/edepmath.c `root-config --cflags --glibs` $(LIBFLAG) 
          mv edepmath.o $(LIBDIROUT)/
  
  $(LIBDIROUT)/weisskopf.o: $(SRCDIR)/weisskopf.c $(INCDIR)/weisskopf.h
          $(CXX) -std=c++98 -fPIC -c $(CFLAGS) $(INCFLAG) $(SRCDIR)/weisskopf.c `root-config --cflags --glibs` $(LIBFLAG) 
          mv weisskopf.o $(LIBDIROUT)/
  
  $(LIBDIROUT)/lindhard.o: $(SRCDIR)/lindhard.c $(INCDIR)/lindhard.h
          $(CXX) -std=c++98 -fPIC -c $(CFLAGS) $(INCFLAG) $(SRCDIR)/lindhard.c `root-config --cflags --glibs` $(LIBFLAG) 
          mv lindhard.o $(LIBDIROUT)/
  
  $(LIBDIROUT)/cascadeProd.o: $(SRCDIR)/cascadeProd.c $(INCDIR)/cascadeProd.h
          $(CXX) -std=c++98 -fPIC -c $(CFLAGS) $(INCFLAG) $(SRCDIR)/cascadeProd.c `root-config --cflags --glibs` $(LIBFLAG) 
          mv cascadeProd.o $(LIBDIROUT)/
  
  $(LIBDIROUT)/libncap.so: $(LIBDIROUT)/isotope_info.o $(LIBDIROUT)/weisskopf.o $(LIBDIROUT)/lindhard.o $(LIBDIROUT)/cascadeProd.o $(LIBDIROUT)/edepmath.o $(LIBDIROUT)/rootUtil.o
          $(CXX) -std=c++98 -fPIC -shared $(LIBDIROUT)/lindhard.o $(LIBDIROUT)/weisskopf.o $(LIBDIROUT)/isotope_info.o $(LIBDIROUT)/cascadeProd.o $(LIBDIROUT)/edepmath.o $(LIBDIROUT)/rootUtil.o `root-config --cflags --glibs` -o $(LIBDIROUT)/libncap.so 
  
  $(BUILDDIR)/realizeCascades: $(LIBDIROUT)/libncap.so $(BUILDDIR)/realizeCascades.cpp
          $(CXX) -std=c++98 -fPIC -Wl,-rpath=$(LIBDIROUT) $(CFLAGS) $(INCFLAG) $(LIBFLAG) $(BUILDDIR)/realizeCascades.cpp `root-config --cflags --glibs` -lncap -o $(BUILDDIR)/realizeCascades 
  
  clean:
          rm -f $(LIBDIROUT)/*.o
          rm -f $(LIBDIROUT)/*.so
          rm -f $(BUILDDIR)/realizeCascades
          rm -f *.o
          rm -f *.so
          rm -rf $(LIBDIROUT)
  </code></pre>
  <p>despite using the <code>-std=c++11</code> or <code>-std=c++98</code> flags once the makefile begins to compile <code>lindhard.c</code> as thus:</p>
  <pre><code>clang++ -std=c++98 -fPIC -c -D__GIT_VERSION=\&quot;v1.0.6-73-g01bc\&quot;
  -IMersenne -Iinc src//lindhard.c `root-config --cflags --glibs` -L. -L/Users/villaa/nrCascadeSim/bin/lib
  </code></pre>
  <p>An error is thrown for each of the many times the <code>register</code> keyword is used:</p>
  <pre><code>Mersenne/MersenneTwister.hh:187:2: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
          register uint32 s1;
          ^~~~~~~~~
  </code></pre>
  <p>I am struggling to find out the reason for this. Is the <code>-std</code> flag not being applied to the pre-processing of include files? Am I going about this the wrong way?</p>