Skip to content

Commit db8ebd3

Browse files
author
Ralph Castain
committed
Fix the optnone attribute, add extension attribute
See how the various compilers handle these Signed-off-by: Ralph Castain <rhc@open-mpi.org>
1 parent e9f4e93 commit db8ebd3

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

config/opal_check_attributes.m4

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,12 +561,18 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [
561561

562562
_OPAL_CHECK_SPECIFIC_ATTRIBUTE([optnone],
563563
[
564-
void foo(void) __attribute__ ((__optnone__));
564+
void __attribute__ ((__optnone__)) foo(void);
565565
void foo(void) { return ; }
566566
],
567567
[],
568568
[])
569569

570+
_OPAL_CHECK_SPECIFIC_ATTRIBUTE([extension],
571+
[
572+
#define FOO __extension__ ({size_t bar; bar = 3;})
573+
],
574+
[],
575+
[])
570576
fi
571577

572578
# Now that all the values are set, define them
@@ -621,4 +627,6 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [
621627
[Whether your compiler has __attribute__ destructor or not])
622628
AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_OPTNONE, [$opal_cv___attribute__optnone],
623629
[Whether your compiler has __attribute__ optnone or not])
630+
AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_EXTENSION, [$opal_cv___attribute__extension],
631+
[Whether your compiler has __attribute__ extension or not])
624632
])

opal/include/opal_config_bottom.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,12 @@
240240
# define __opal_attribute_optnone__
241241
#endif
242242

243+
#if OPAL_HAVE_ATTRIBUTE_EXTENSION
244+
# define __opal_attribute_extension__ __extension__
245+
#else
246+
# define __opal_attribute_extension__
247+
#endif
248+
243249
# if OPAL_C_HAVE_VISIBILITY
244250
# define OPAL_DECLSPEC __opal_attribute_visibility__("default")
245251
# define OPAL_MODULE_DECLSPEC __opal_attribute_visibility__("default")

orte/orted/orted_submit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ char MPIR_attach_fifo[MPIR_MAX_PATH_LENGTH] = {0};
173173
int MPIR_force_to_main = 0;
174174
static void orte_debugger_init_before_spawn(orte_job_t *jdata);
175175

176-
ORTE_DECLSPEC void* MPIR_Breakpoint(void) __opal_attribute_optnone__;
176+
ORTE_DECLSPEC void* __opal_attribute_optnone__ MPIR_Breakpoint(void);
177177

178178
/*
179179
* Breakpoint function for parallel debuggers

0 commit comments

Comments
 (0)