1
1

Fix the optnone attribute, add extension attribute

See how the various compilers handle these

Signed-off-by: Ralph Castain <rhc@open-mpi.org>
This commit is contained in:
Ralph Castain 2017-12-18 19:18:53 -08:00
parent e9f4e93800
commit db8ebd33ad
3 changed files with 16 additions and 2 deletions

View File

@ -561,12 +561,18 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [
_OPAL_CHECK_SPECIFIC_ATTRIBUTE([optnone],
[
void foo(void) __attribute__ ((__optnone__));
void __attribute__ ((__optnone__)) foo(void);
void foo(void) { return ; }
],
[],
[])
_OPAL_CHECK_SPECIFIC_ATTRIBUTE([extension],
[
#define FOO __extension__ ({size_t bar; bar = 3;})
],
[],
[])
fi
# Now that all the values are set, define them
@ -621,4 +627,6 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [
[Whether your compiler has __attribute__ destructor or not])
AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_OPTNONE, [$opal_cv___attribute__optnone],
[Whether your compiler has __attribute__ optnone or not])
AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_EXTENSION, [$opal_cv___attribute__extension],
[Whether your compiler has __attribute__ extension or not])
])

View File

@ -240,6 +240,12 @@
# define __opal_attribute_optnone__
#endif
#if OPAL_HAVE_ATTRIBUTE_EXTENSION
# define __opal_attribute_extension__ __extension__
#else
# define __opal_attribute_extension__
#endif
# if OPAL_C_HAVE_VISIBILITY
# define OPAL_DECLSPEC __opal_attribute_visibility__("default")
# define OPAL_MODULE_DECLSPEC __opal_attribute_visibility__("default")

View File

@ -173,7 +173,7 @@ char MPIR_attach_fifo[MPIR_MAX_PATH_LENGTH] = {0};
int MPIR_force_to_main = 0;
static void orte_debugger_init_before_spawn(orte_job_t *jdata);
ORTE_DECLSPEC void* MPIR_Breakpoint(void) __opal_attribute_optnone__;
ORTE_DECLSPEC void* __opal_attribute_optnone__ MPIR_Breakpoint(void);
/*
* Breakpoint function for parallel debuggers