xunzhang / gflags

Automatically exported from code.google.com/p/gflags
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

non-portable use of isnan/isinf math macros #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
isnan and isinf are macro's in mac os x. causing a failure when trying to
compile graph_unittest.cc. EXPECT_* macros make some non-portable
assumptions about is*.

BTW after a quick fix the unit test runs correctly!

Original issue reported on code.google.com by crispywa...@gmail.com on 25 Apr 2007 at 10:08

GoogleCodeExporter commented 9 years ago
Thanks for the heads-up.  We don't have an OS X machine on for testing, but I've
rewritten the macros in a way that shouldn't depend on how is* are implemented
(though I admit I'm confused why the EXPECT macros were having trouble -- they 
should
deal fine with isnan being a macro).  This fix will go out with the next 
release.

Original comment by csilv...@gmail.com on 25 Apr 2007 at 10:31

GoogleCodeExporter commented 9 years ago

Original comment by csilv...@gmail.com on 25 Apr 2007 at 10:31

GoogleCodeExporter commented 9 years ago
I looked into this a bit more, and it seems like OS X has a buggy math.h
implementation, particularly for isnan:
   http://www.lemurproject.org/phorum/read.php?11,1702

So I'm not sure my fix will actually fix things.  Can you clarify exactly what 
errors
you got trying to use this on OS X, what version of OS X you were using, what
compiler version you were using, and what "quick fixes" you made?

Thanks!
craig

Original comment by csilv...@gmail.com on 25 Apr 2007 at 11:24

GoogleCodeExporter commented 9 years ago
} So I'm not sure my fix will actually fix things.

Never mind, I got my hands on a darwin machine and tested out my fix, and it 
works
fine (the problem was, indeed, solely that the gflags code assumed isinf was a
function, when in darwin it's a macro).  So this should be fixed in the next 
release.

Original comment by csilv...@gmail.com on 27 Apr 2007 at 10:13

GoogleCodeExporter commented 9 years ago
I just released gflags 0.5, which should fix this problem.

Original comment by csilv...@gmail.com on 13 Jun 2007 at 12:36

GoogleCodeExporter commented 9 years ago
0.5 does indeed fix this issue.

thanks!

chris

Original comment by crispywa...@gmail.com on 21 Jun 2007 at 9:49