Wireshark-dev: Re: [Wireshark-dev] Optimizer options with autotools and CMake?
From: Jeff Morriss <[email protected]>
Date: Sun, 03 Aug 2014 14:13:53 -0400
On 08/03/2014 01:40 PM, Guy Harris wrote:
I've noticed, on occasion, that sometimes the CMake builds on the UN*X buildbots get warnings that the autotools builds don't.

Recently, I tried to figure out what was different about the CMake builds; after some fixes that removed some incorrect differences between them, I eventually stumbled across the way to get CMake to produce makefiles that did verbose builds, printing the compile command as part of the build output, and found that the difference was very simple - autotools builds weren't building with a -O option, while CMake builds were building with -O2.

The optimizer is what does some, if not all, of the dataflow analysis that produces "use before set" warnings, so those warnings were showing up on the CMake builds but not the autotools builds.

So:

	Is there any reason not to do whatever is necessary to use a -O option on the autotools builds?
Hmmm, that's funny: my (autofoo-generated) Makefile's have "-O2" in 
CFLAGS and CXXFLAGS (I had noticed because sometimes I have to disable 
it to get optimization out of the way when debugging).
Reading this thread:

https://lists.gnu.org/archive/html/autoconf/2006-04/msg00032.html

It seems that this is because autoconf (or my distribution's build of it anyway) chose this default for me.
Were chasing down this difference on the Mac buildbots or the Ubuntu 
one(s)?  Maybe the answer is a simple autoconf upgrade away.
Then again, if there are enough autoconfs out there that don't have this 
(pretty sane, IMO) default then doing it ourselves is probably not 
unreasonable.