Home page logo

nmap-dev logo Nmap Development mailing list archives

gcc 4 check is broken (luckily!)
From: Solar Designer <solar () openwall com>
Date: Mon, 20 Jul 2009 04:18:19 +0400


I am getting:

checking whether the compiler is gcc 4 or greater... yes

and -fno-strict-aliasing on gcc invocations on my system with gcc 3.4.5.
This is great, because gcc 3.4.5 supports the strict aliasing
optimizations as well, which would be problematic given Nmap's code.

The bug is here:

  if test 4 -ge $nmap_gcc_major_version; then

basically, the test is reversed, but due to the "or equal" it works
right for gcc 4 (but will break for gcc 5).  My suggested fix is:

  if test $nmap_gcc_major_version -ge 3; then

...or perhaps the minor version will need to be checked as well,
depending on when the -fno-strict-aliasing option was introduced (I did
not check, I am merely reporting a bug now).  Of course, the comments
and the message will need to be adjusted as well.

The impact of the bug is that builds with gcc 2.x will fail (whereas
2.95.x are fairly reasonable versions of gcc).


Sent through the nmap-dev mailing list
Archived at http://SecLists.Org

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]