Skip to content

Commit

Permalink
Fix the optnone attribute, add extension attribute
Browse files Browse the repository at this point in the history
See how the various compilers handle these

Signed-off-by: Ralph Castain <rhc@open-mpi.org>
  • Loading branch information
Ralph Castain committed Dec 19, 2017
1 parent e9f4e93 commit db8ebd3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
10 changes: 9 additions & 1 deletion config/opal_check_attributes.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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])
])
6 changes: 6 additions & 0 deletions opal/include/opal_config_bottom.h
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion orte/orted/orted_submit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit db8ebd3

Please sign in to comment.