This is the mail archive of the
ecos-bugs@sourceware.org
mailing list for the eCos project.
[Bug 1000636] tests/tm_basic.cxx: bad definition for max()
- From: bugzilla-daemon at ecoscentric dot com
- To: ecos-bugs at ecos dot sourceware dot org
- Date: Fri, 14 Nov 2008 09:59:37 +0000
- Subject: [Bug 1000636] tests/tm_basic.cxx: bad definition for max()
- References: <bug-1000636-13@http.bugs.ecos.sourceware.org/>
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1000636
--- Comment #3 from David Tylski <david.tylski@parrot.com> 2008-11-14 09:59:36 ---
There are 2 potential ones:
- if max() is defined elsewhere (but with the right definition)... in that
case, for each
xxx = max(boundary, xxx);
the value will be set to the boundary (which is different from testing using
the initial xxx value).
- if anytime later, you want to use max() to get some statistics of your tests,
you may not even notice that your results are wrong.
To be sure, the definition of max() could also be "sanity protected".
#ifdef max
#error max already defined!
#else
#define max(n,m) (m > n ? n : m)
#endif
The bug initially comes from the use of max() for sanity checks, while min()
should instead be used; max() not being defined, it is defined in the .cxx
source, whatever the standard max() function.
However I noticed that this little fix will never be scheduled.
--
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.