bugchannelflow: a spectral fluid-flow simulator - Bugs: bug #8421, a macro defination does't work in...

 
 

bug #8421: a macro defination does't work in mathdefs.h

Submitted by:  None
Submitted on:  Fri 02 Apr 2004 02:15:12 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Works For Me
Privacy: PublicAssigned to: John F. Gibson <gibson17>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 08 Jun 2005 04:08:50 PM UTC, comment #2:

This macro was removed some time ago. Can someone tell me if current Windows compilers handle Channelflow's assertions properly? I.e. do they compile and produce error messages with line numbers when the assertion fails?

John

John F. Gibson <gibson17>
Project AdministratorIn charge of this item.
Mon 05 Apr 2004 01:56:05 PM UTC, comment #1:

Channelflow is written to use the glibc assert macros found in /usr/include/assert.h, under GNU/Linux and gcc. The macro you refer to is surrounded by an #ifdef WIN32, so gcc should never to try compile it. How is Are you using the Makefiles provided with channelflow?

The asserts have always been a problem under Windows. The
assetion macros at the end of mathdefs.h, within #ifdef WIN32, were copied from glibc's assert.h. Dietmar Rempfer and I did this a couple years ago. Maybe you could look for a working assert macro system within Visual C++.

In the meantime, the modification you list should be ok. You might want to try

#define assert(expr) (if(!expr) {assertion_error();}

with assertion_error() declared and defined as

void assertion_error(); // in mathdefs.h

void assertion_error() { // in mathdefs.cpp
cerr << "Assertion failed. Aborting." << endl;
}

In general, I don't have a Windows system to test code on, and I prefer to focus my development efforts on GNU/Linux.
But if others contribute modifications for compilation under Windows, I'm happy to include them.

John

John F. Gibson <gibson17>
Project AdministratorIn charge of this item.
Fri 02 Apr 2004 02:15:12 PM UTC, original submission:

line 181 of mathdefs.h
#define assert(expr) (if(!expr) {cout << "Assertion failed. "<<endl; abort();}) can't work in gcc and msvc6

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 08 Jun 2005 04:08:50 PM UTCgibson17Open/ClosedOpen=>Closed
Wed 21 Apr 2004 08:31:03 PM UTCgibson17StatusNone=>Works For Me
Mon 05 Apr 2004 01:56:05 PM UTCgibson17Assigned toNone=>gibson17

Back to the top


Powered by Savane 3.1-cleanup1