This is the mail archive of the ecos-bugs@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug 1000636] tests/tm_basic.cxx: bad definition for max()


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]