Closed karel-m closed 5 years ago
IMO __attribute__((deprecated("some message")))
is supported since gcc-4.5.0 see:
So perhaps:
- #if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 301)
+ #if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 405)
Or more complicated:
- #if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 301)
+ #if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 405)
# define MP_DEPRECATED(x) __attribute__((deprecated("replaced by " #x)))
# define PRIVATE_MP_DEPRECATED_PRAGMA(s) _Pragma(#s)
# define MP_DEPRECATED_PRAGMA(s) PRIVATE_MP_DEPRECATED_PRAGMA(GCC warning s)
+ #elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 301)
+ # define MP_DEPRECATED(x) __attribute__((deprecated))
+ # define PRIVATE_MP_DEPRECATED_PRAGMA(s) _Pragma(#s)
+ # define MP_DEPRECATED_PRAGMA(s) PRIVATE_MP_DEPRECATED_PRAGMA(GCC warning s)
#elif defined(_MSC_VER) && _MSC_VER >= 1500
# define MP_DEPRECATED(x) __declspec(deprecated("replaced by " #x))
# define MP_DEPRECATED_PRAGMA(s) __pragma(message(s))
#else
# define MP_DEPRECATED(s)
# define MP_DEPRECATED_PRAGMA(s)
#endif
@karel-m This has been fixed in https://github.com/libtom/libtommath/pull/262/commits/1eceaeaad2cf1df708b07da3818a3ddbdd39ef05 in #262
The #262 is not correct
@karel-m What do you mean? Is not correct? #262 has not been merged yet, do you mean that?
#if defined(__GNUC__) && __GNUC__ >= 4
is wrong and will cause a failure with e,g, gcc-4.4 see my research above.
@karel-m Thank you. Fixed in #262
Great, closing this one.
Building with gcc-3.4.5 fails with error:
It looks like gcc 3.x does support:
but not: