View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000895CMakepublic2004-05-28 14:342004-06-01 14:08
ReporterMathieu Malaterre 
Assigned ToBrad King 
PrioritylowSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000895: NDEBUG and assert
DescriptionCMake should allow passing -DNDEBUG, in CMAKE_CXX_FLAGS_RELEASE (even if this does not exactly match the orther project we are linking to). For example we could have our own project linking to VTK, where we would pass -DNDEBUG in RELEASE, but where VTK does not specify it (since it does not need it).

man assert:
NAME
       assert - abort the program if assertion is false
 
SYNOPSIS
       #include <assert.h>
 
       void assert(scalar expression);
 
DESCRIPTION
       If the macro NDEBUG was defined at the moment <assert.h> was last included, the macro assert() generates no code, and hence does nothing at all. Otherwise, the macro assert() prints an error message to standard output and terminates the program by calling abort() if expression is false (i.e., compares equal to zero).
 
       The purpose of this macro is to help the programmer find bugs in his program. The message "assertion failed in file foo.c, function do_bar(), line 1287" is of no help at all to a user.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0001164)
Bill Hoffman (manager)
2004-06-01 12:51

CMake does allow this, I think the problem is in VTK.
(0001166)
Brad King (manager)
2004-06-01 14:08

The bug is in CMake. I've modified the platform configuration files to add -DNDEBUG to the flags for release builds.

Checking in HP-UX.cmake;
/cvsroot/CMake/CMake/Modules/Platform/HP-UX.cmake,v <-- HP-UX.cmake
new revision: 1.14; previous revision: 1.13
done
Checking in IRIX.cmake;
/cvsroot/CMake/CMake/Modules/Platform/IRIX.cmake,v <-- IRIX.cmake
new revision: 1.8; previous revision: 1.7
done
Checking in IRIX64.cmake;
/cvsroot/CMake/CMake/Modules/Platform/IRIX64.cmake,v <-- IRIX64.cmake
new revision: 1.11; previous revision: 1.10
done
Checking in OSF1.cmake;
/cvsroot/CMake/CMake/Modules/Platform/OSF1.cmake,v <-- OSF1.cmake
new revision: 1.11; previous revision: 1.10
done
Checking in Windows-bcc32.cmake;
/cvsroot/CMake/CMake/Modules/Platform/Windows-bcc32.cmake,v <-- Windows-bcc32.
cmake
new revision: 1.33; previous revision: 1.32
done
Checking in gcc.cmake;
/cvsroot/CMake/CMake/Modules/Platform/gcc.cmake,v <-- gcc.cmake
new revision: 1.10; previous revision: 1.9
done

 Issue History
Date Modified Username Field Change


Copyright © 2000 - 2018 MantisBT Team