Making all in Main
c++ -DHAVE_CONFIG_H -I. -I. -I../../src/Include -I../.. -I../../src  
-I/usr/local/include -DPKGLIBDIR=\"/usr/local/lib/FlightGear\" -g -O1 -finline-limit-6 
-finline-functions -Wall -pedantic -Wpointer-arith -c main.cxx
main.cxx: In function `void fgUpdateTimeDepCalcs()':
main.cxx:766: warning: unused variable `int i'
main.cxx: In function `void fgLoadDCS()':
main.cxx:1742: warning: unused variable `class ssgVertexArray * lights'
main.cxx:1746: warning: `int light_type' might be used uninitialized in this function

... and there are many others in other files.

I have realised that in order for warnings to be useful, it is no good for them just 
to scroll past and then be lost until after the next "make clean".  At work, I capture 
the compiler output for each file and then display all the warnings and errors at the 
end of the build.  Not just those from the files that were compiled during the last 
run of "make", but for all source files.  I don't want to force everyone to see the 
warnings if they don't want to, but I think we should provide a set-up that makes it 
easy to do so.

Three things are needed:

1. Enable warnings.  e.g.

  GCCFLAGS="-g -O1 -Wall -pedantic -Wpointer-arith"
  CFLAGS="$GCCFLAGS" CXXFLAGS="$GCCFLAGS" ./configure

2. Save the error output for each C file as (e.g.) ".deps/*.err".  E.g. in each 
Makefile.in:

  %.o: %.cxx
          @echo '$(CXXCOMPILE) -c $<'; \
-         $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< 2> .deps/$(*F).err
+         $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< 2> .deps/$(*F).err
          @-cp .deps/$(*F).pp .deps/$(*F).P; \
          tr ' ' '\012' < .deps/$(*F).pp \
            | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
              >> .deps/$(*F).P; \
-         rm .deps/$(*F).pp
+         rm .deps/$(*F).pp; \
+         cat .deps/$(*F).err

3. Display the results (when?).  e.g.

  find . -type d -name .deps -exec cat {}/*.err \;

So, can anyone suggest good ways of doing each of these steps, especially step 2: how 
do I get that change into every Makefile.in, or what would be a better way?

- Julian

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to