Le Monday 2 January 2012 19:06:46, Paul Eggert a écrit :
> On 01/02/12 07:46, Bastien ROUCARIES wrote:
> > Unfortunatly gnulib add some stuff snippet like noreturn in config.h
> > that are not really safe from a fortran point of view.
> 
> Could you explain the problem a bit more?  I wasn't aware
> that Fortran code used the identifier "_Noreturn".

_Noreturn is safe but I am more affraind by the fact that cpp run in 
traditionnal mode and could choke if snippet include C89/C99 
preprocessor directive.

> 
> I suppose you could do something like this:
> 
>   #include <config.h>
>   #undef _Noreturn
> 
> and package this up into a .h file that your Fortran programs
> include.

Yes this could work, but I will prefer something that will avoid snippet if 
other language than c,c++ (objc?)

I merely use config.h for project that include c/fortran/c++/python mix and 
even verilog ...

My config.h will consist of only #define something 1 guarded by #if #endif that 
is safe is all the previous language.

Antoher problem, but not surelly related I use AX_PREFIX_CONFIG_H and I get 
__UNUSED_PARAMETER prefixed...

Thanks 

Bastien
/* config.h.  Generated from config.h.in by configure.  */
/* config.h.in.  Generated from configure.ac by autoheader.  */

/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

/* Define to 1 or 0, depending whether the compiler supports simple visibility
   declarations. */
#define HAVE_VISIBILITY 1

/* Define to 1 if the system has the type `_Bool'. */
#define HAVE__BOOL 1

/* Define to the sub-directory in which libtool stores uninstalled libraries.
   */
#define LT_OBJDIR ".libs/"

/* Name of package */
#define PACKAGE "opencernlibminuit"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "opencern...@lists.tuxfamily.org"

/* Define to the full name of this package. */
#define PACKAGE_NAME "opencernlibminuit"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "opencernlibminuit 2011.12.22"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "opencernlibminuit"

/* Define to the home page for this package. */
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "2011.12.22"

/* The number of bytes in type int * */
#define SIZEOF_INT_P 8

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

/* Version number of package */
#define VERSION "2011.12.22"

/* The _Noreturn keyword of draft C1X.  */
#ifndef _Noreturn
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
      || 0x5110 <= __SUNPRO_C)
#  define _Noreturn __attribute__ ((__noreturn__))
# elif defined _MSC_VER && 1200 <= _MSC_VER
#  define _Noreturn __declspec (noreturn)
# else
#  define _Noreturn
# endif
#endif


/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
   the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
   earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
   __APPLE__ && __MACH__ test for MacOS X.
   __APPLE_CC__ tests for the Apple compiler and its version.
   __STDC_VERSION__ tests for the C99 mode.  */
#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
# define __GNUC_STDC_INLINE__ 1
#endif

/* Define as a marker that can be attached to declarations that might not
    be used.  This helps to reduce warnings, such as from
    GCC -Wunused-parameter.  */
#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
# define _GL_UNUSED __attribute__ ((__unused__))
#else
# define _GL_UNUSED
#endif
/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
   is a misnomer outside of parameter lists.  */
#define _UNUSED_PARAMETER_ _GL_UNUSED

/* The __pure__ attribute was added in gcc 2.96.  */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
#else
# define _GL_ATTRIBUTE_PURE /* empty */
#endif

/* The __const__ attribute was added in gcc 2.95.  */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
#else
# define _GL_ATTRIBUTE_CONST /* empty */
#endif

#ifndef _OPENCERNLIBMINUIT_CONFIG_H
#define _OPENCERNLIBMINUIT_CONFIG_H 1
 
/* opencernlibminuit-config.h. Generated automatically at end of configure. */
/* config.h.  Generated from config.h.in by configure.  */
/* config.h.in.  Generated from configure.ac by autoheader.  */

/* Define to 1 if you have the <dlfcn.h> header file. */
#ifndef OPENCERNLIBMINUIT_HAVE_DLFCN_H
#define OPENCERNLIBMINUIT_HAVE_DLFCN_H 1
#endif

/* Define to 1 if you have the <inttypes.h> header file. */
#ifndef OPENCERNLIBMINUIT_HAVE_INTTYPES_H
#define OPENCERNLIBMINUIT_HAVE_INTTYPES_H 1
#endif

/* Define to 1 if you have the <memory.h> header file. */
#ifndef OPENCERNLIBMINUIT_HAVE_MEMORY_H
#define OPENCERNLIBMINUIT_HAVE_MEMORY_H 1
#endif

/* Define to 1 if you have the <stdint.h> header file. */
#ifndef OPENCERNLIBMINUIT_HAVE_STDINT_H
#define OPENCERNLIBMINUIT_HAVE_STDINT_H 1
#endif

/* Define to 1 if you have the <stdlib.h> header file. */
#ifndef OPENCERNLIBMINUIT_HAVE_STDLIB_H
#define OPENCERNLIBMINUIT_HAVE_STDLIB_H 1
#endif

/* Define to 1 if you have the <strings.h> header file. */
#ifndef OPENCERNLIBMINUIT_HAVE_STRINGS_H
#define OPENCERNLIBMINUIT_HAVE_STRINGS_H 1
#endif

/* Define to 1 if you have the <string.h> header file. */
#ifndef OPENCERNLIBMINUIT_HAVE_STRING_H
#define OPENCERNLIBMINUIT_HAVE_STRING_H 1
#endif

/* Define to 1 if you have the <sys/stat.h> header file. */
#ifndef OPENCERNLIBMINUIT_HAVE_SYS_STAT_H
#define OPENCERNLIBMINUIT_HAVE_SYS_STAT_H 1
#endif

/* Define to 1 if you have the <sys/types.h> header file. */
#ifndef OPENCERNLIBMINUIT_HAVE_SYS_TYPES_H
#define OPENCERNLIBMINUIT_HAVE_SYS_TYPES_H 1
#endif

/* Define this if your system can create weak aliases */
/* #undef HAVE_SYS_WEAK_ALIAS */

/* Define this if weak aliases may be created with __attribute__ */
/* #undef HAVE_SYS_WEAK_ALIAS_ATTRIBUTE */

/* Define this if weak aliases may be created with #pragma _CRI duplicate */
/* #undef HAVE_SYS_WEAK_ALIAS_CRIDUPLICATE */

/* Define this if weak aliases in other files are honored */
/* #undef HAVE_SYS_WEAK_ALIAS_CROSSFILE */

/* Define this if weak aliases may be created with #pragma _HP_SECONDARY_DEF
   */
/* #undef HAVE_SYS_WEAK_ALIAS_HPSECONDARY */

/* Define this if weak aliases may be created with #pragma weak */
/* #undef HAVE_SYS_WEAK_ALIAS_PRAGMA */

/* Define to 1 if you have the <unistd.h> header file. */
#ifndef OPENCERNLIBMINUIT_HAVE_UNISTD_H
#define OPENCERNLIBMINUIT_HAVE_UNISTD_H 1
#endif

/* Define to 1 or 0, depending whether the compiler supports simple visibility
   declarations. */
#ifndef OPENCERNLIBMINUIT_HAVE_VISIBILITY
#define OPENCERNLIBMINUIT_HAVE_VISIBILITY 1
#endif

/* Define to 1 if the system has the type `_Bool'. */
#ifndef OPENCERNLIBMINUIT_HAVE__BOOL
#define OPENCERNLIBMINUIT_HAVE__BOOL 1
#endif

/* Define to the sub-directory in which libtool stores uninstalled libraries.
   */
#ifndef OPENCERNLIBMINUIT_LT_OBJDIR
#define OPENCERNLIBMINUIT_LT_OBJDIR ".libs/"
#endif

/* Name of package */
#ifndef OPENCERNLIBMINUIT_PACKAGE
#define OPENCERNLIBMINUIT_PACKAGE "opencernlibminuit"
#endif

/* Define to the address where bug reports for this package should be sent. */
#ifndef OPENCERNLIBMINUIT_PACKAGE_BUGREPORT
#define OPENCERNLIBMINUIT_PACKAGE_BUGREPORT "opencern...@lists.tuxfamily.org"
#endif

/* Define to the full name of this package. */
#ifndef OPENCERNLIBMINUIT_PACKAGE_NAME
#define OPENCERNLIBMINUIT_PACKAGE_NAME "opencernlibminuit"
#endif

/* Define to the full name and version of this package. */
#ifndef OPENCERNLIBMINUIT_PACKAGE_STRING
#define OPENCERNLIBMINUIT_PACKAGE_STRING "opencernlibminuit 2011.12.22"
#endif

/* Define to the one symbol short name of this package. */
#ifndef OPENCERNLIBMINUIT_PACKAGE_TARNAME
#define OPENCERNLIBMINUIT_PACKAGE_TARNAME "opencernlibminuit"
#endif

/* Define to the home page for this package. */
#ifndef OPENCERNLIBMINUIT_PACKAGE_URL
#define OPENCERNLIBMINUIT_PACKAGE_URL ""
#endif

/* Define to the version of this package. */
#ifndef OPENCERNLIBMINUIT_PACKAGE_VERSION
#define OPENCERNLIBMINUIT_PACKAGE_VERSION "2011.12.22"
#endif

/* The number of bytes in type int * */
#ifndef OPENCERNLIBMINUIT_SIZEOF_INT_P
#define OPENCERNLIBMINUIT_SIZEOF_INT_P 8
#endif

/* Define to 1 if you have the ANSI C header files. */
#ifndef OPENCERNLIBMINUIT_STDC_HEADERS
#define OPENCERNLIBMINUIT_STDC_HEADERS 1
#endif

/* Version number of package */
#ifndef OPENCERNLIBMINUIT_VERSION
#define OPENCERNLIBMINUIT_VERSION "2011.12.22"
#endif

/* The _Noreturn keyword of draft C1X.  */
#ifndef _Noreturn
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
      || 0x5110 <= __SUNPRO_C)
#  define _Noreturn __attribute__ ((__noreturn__))
# elif defined _MSC_VER && 1200 <= _MSC_VER
#  define _Noreturn __declspec (noreturn)
# else
#  define _Noreturn
# endif
#endif


/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
   the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
   earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
   __APPLE__ && __MACH__ test for MacOS X.
   __APPLE_CC__ tests for the Apple compiler and its version.
   __STDC_VERSION__ tests for the C99 mode.  */
#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
# define __GNUC_STDC_INLINE__ 1
#endif

/* Define as a marker that can be attached to declarations that might not
    be used.  This helps to reduce warnings, such as from
    GCC -Wunused-parameter.  */
#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
# define _GL_UNUSED __attribute__ ((__unused__))
#else
# define _GL_UNUSED
#endif
/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
   is a misnomer outside of parameter lists.  */
#ifndef OPENCERNLIBMINUIT__UNUSED_PARAMETER_
#define OPENCERNLIBMINUIT__UNUSED_PARAMETER_ _GL_UNUSED
#endif

/* The __pure__ attribute was added in gcc 2.96.  */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
#else
# define _GL_ATTRIBUTE_PURE /* empty */
#endif

/* The __const__ attribute was added in gcc 2.95.  */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
#else
# define _GL_ATTRIBUTE_CONST /* empty */
#endif

 
/* once: _OPENCERNLIBMINUIT_CONFIG_H */
#endif

Reply via email to