[cmake-developers] [CMake 0013955]: warning: assuming signed overflow does not occur when simplifying conditional to constant

Mantis Bug Tracker mantis at public.kitware.com
Wed Feb 27 03:39:13 EST 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://cmake.org/Bug/view.php?id=13955 
====================================================================== 
Reported By:                Mathieu Malaterre
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13955
Category:                   (No Category)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-02-27 03:39 EST
Last Modified:              2013-02-27 03:39 EST
====================================================================== 
Summary:                    warning: assuming signed overflow does not occur
when simplifying conditional to constant
Description: 
Cmake generates code which confuses gcc optimizer:


/home/mathieu/Perso/gdcm-gcc/Testing/Source/Common/Cxx/gdcmCommonTests.cxx: In
function ‘int main(int, char**)’:
/home/mathieu/Perso/gdcm-gcc/Testing/Source/Common/Cxx/gdcmCommonTests.cxx:218:
warning: assuming signed overflow does not occur when simplifying conditional to
constant [-Wstrict-overflow]

Code generated by cmake is:

...
  /* If partial match is requested.  */
  if(testToRun == -1 && ac > 1)
    {
    partial_match = (strcmp(av[1], "-R") == 0) ? 1 : 0;
    }
...


Looks like gcc thinks ac can be negative...
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-02-27 03:39 Mathieu MalaterreNew Issue                                    
======================================================================




More information about the cmake-developers mailing list