-1

I was recently dealing with an error that should have easily been realized with a simple compiler warning.
Does anyone know how to get compiler warnings to show up when compiling JUCE projects with make on Ubuntu?

I attempted:

  • make -Wall from the gcc/gnu Warning Options docs -> no change
  • make V=1 as commented in the makefile -> it was verbose, but didn't show the warnings
  • Editing the live build settings in the Projucer -> live build doesn't work on Ubuntu

Edit: Answered by OMGtechy

To add compiler warnings to the build: edit the Linux Makefile settings in the Exporter tab of the Projucer File Manager (See the picture in his answer). However, I didn't see any "uninitialized variable" warnings until I also ran with the optimization flag -O2. Apparently gcc is bad with that warning.

brenthompson2
  • 391
  • 3
  • 9
  • Which build settings did you edit? The live ones will probably have no effect on a make build. Did you notice the build commands change at all? Could be a bug. Also, to the downvoters, in the context of JUCE it's quite clear what the OP is asking. – OMGtechy Aug 26 '17 at 10:42

1 Answers1

0

You want to add -Wallto your exporter compiler flags, possibly with -Werror too. Just adding them to the live build flags will only affect the Projucer's live build feature.

Where to add the compiler flags

OMGtechy
  • 7,935
  • 8
  • 48
  • 83
  • 1
    This did work to apply compiler flags to the build. However, I didn't see any uninitialized variable warnings until I used `-O2` also. Apparently [gcc is bad with that warning](https://stackoverflow.com/questions/17705880/gcc-failing-to-warn-of-uninitialized-variable) . – brenthompson2 Aug 27 '17 at 17:04