INT32_MAX undefined (in 'modular-int32.h' and 'modular-balanced-int32.h'), rev148

190 views
Skip to first unread message

jack1977

unread,
May 13, 2011, 8:53:52 AM5/13/11
to ffpack-devel
Dear FFPACK-developers,


in recently GCC compilers INT32_MAX seems to be defined out, see
discussion on
http://stackoverflow.com/questions/1471353/whats-the-c-equivalent-of-uint32-max

Maybe INT32_MAX should be defined like that (or similar):

...
#include <limits.h>
#define INT32_MAX std::numeric_limits<int32_t>::max()
...


Thanks,


Jack


P.S
this issue also concerns the 'Givaro' package.

Brice Boyer

unread,
May 13, 2011, 10:59:25 AM5/13/11
to ffpack...@googlegroups.com
hello !

did you get into troube because of this macro ?

If not, in a gcc stdint.h, you can read :

<code>
/* The ISO C99 standard specifies that in C++ implementations these
   macros should only be defined if explicitly requested.  */
#if !defined __cplusplus || defined __STDC_LIMIT_MACROS
</code>

in gcc-4.6 they are still there and I don't think these macros/typenames will disappear ?!

If there exists compilers that does not understand/define INT32_MAX, then yes, maybe we should provide a m4 and fall back to using numeric_limits.


and this issue is as well there in linbox...

thank you !

2011/5/13 jack1977 <kro...@uni-math.gwdg.de>

--
You received this message because you are subscribed to the Google Groups "ffpack-devel" group.
To post to this group, send email to ffpack...@googlegroups.com.
To unsubscribe from this group, send email to ffpack-devel...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ffpack-devel?hl=en.




--
                                                      Brice Boyer.
____________________________________________________________
brice...@imag.fr                                     Tél. +33(0)4 76 51 45 61
Université Joseph Fourier, Grenoble I.
Laboratoire Jean Kuntzmann, Mathématiques Appliquées et Informatique
LJK - UJF  BP53 38041 Grenoble cedex FRANCE
http://ljk.imag.fr/membres/Brice.Boyer
____________________________________________________________

"Jakob Kröker"

unread,
May 13, 2011, 11:41:51 AM5/13/11
to ffpack...@googlegroups.com
Hello,


I get into trouble, because 'stdint.h' is included by the user and/or by
another library earlier than by FFPACK (and then __STDC_LIMIT_MACROS is
usually not defined )

Therefore I vote for the 'include <limits.h> ..'
solution as fallback.


Best,


Jack

Brice Boyer

unread,
May 13, 2011, 11:49:11 AM5/13/11
to ffpack...@googlegroups.com
okay, good point.
I'll correct this soon (on monday)

2011/5/13 "Jakob Kröker" <kro...@uni-math.gwdg.de>

Brice Boyer

unread,
May 14, 2011, 7:14:53 PM5/14/11
to ffpack...@googlegroups.com
A rainy week-end, so... plenty of time for this tedious task !!

Your problem should be fixed now and the code should compile warning free for -Wall -Wextra -Wno-unused-parameter -Wuninitialized -Wconversion -Wcast-qual for Givaro/Fflas-Ffpack/LinBox on x86(_64). It should even run correctly. I can't garantee no bugs were included (because these mad flags revealed some obscure things...) :)

thank you for your mail !

2011/5/13 "Jakob Kröker" <kro...@uni-math.gwdg.de>
Reply all
Reply to author
Forward
0 new messages