Changeset 4551

Show
Ignore:
Timestamp:
05/13/09 13:25:24 (10 months ago)
Author:
goodell
Message:

Refactor the "has no symbols" suppression into a macro.

Also clean up hydra "has no symbols" warnings.

Reviewed by balaji@.

Location:
mpich2/trunk/src
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • mpich2/trunk/src/include/mpiutil.h

    r4257 r4551  
    117117#define MPIU_QUOTE2(A) #A 
    118118 
     119/* This macro is used to silence warnings from the Mac OS X linker when 
     120 * an object file "has no symbols".  The unused attribute prevents a 
     121 * warning about the unused dummy variable while the used attribute 
     122 * prevents the compiler from discarding the symbol altogether.  This 
     123 * macro should be used at the top of any file that might not define any 
     124 * other variables or functions (perhaps due to conditional compilation 
     125 * via the preprocessor).  A semicolon is expected after each invocation 
     126 * of this macro. */ 
     127#define MPIU_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING \ 
     128    static int MPIU_UNIQUE_SYMBOL_NAME(dummy) ATTRIBUTE((unused,used)) = 0 
     129 
     130/* we jump through a couple of extra macro hoops to append the line 
     131 * number to the variable name in order to reduce the chance of a name 
     132 * collision with headers that might be included in the translation 
     133 * unit */ 
     134#define MPIU_UNIQUE_SYMBOL_NAME(prefix_) MPIU_UNIQUE_IMPL1_(prefix_##_unique_L,__LINE__) 
     135#define MPIU_UNIQUE_IMPL1_(prefix_,line_) MPIU_UNIQUE_IMPL2_(prefix_,line_) 
     136#define MPIU_UNIQUE_IMPL2_(prefix_,line_) MPIU_UNIQUE_IMPL3_(prefix_,line_) 
     137#define MPIU_UNIQUE_IMPL3_(prefix_,line_) prefix_##line_ 
     138 
    119139#endif /* !defined(MPIUTIL_H_INCLUDED) */ 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_lmt_dma.c

    r4310 r4551  
    22#include "mpid_nem_datatypes.h" 
    33 
    4 /* here to prevent "has no symbols" warnings from ranlib on OS X */ 
    5 static int dummy ATTRIBUTE((unused,used)) = 0; 
     4MPIU_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING; 
    65 
    76/* TODO there might be a better way to do this, the current system will lead to 
  • mpich2/trunk/src/mpid/ch3/channels/nemesis/nemesis/src/mpid_nem_lmt_vmsplice.c

    r4310 r4551  
    22#include "mpid_nem_datatypes.h" 
    33 
    4 /* here to prevent "has no symbols" warnings from ranlib on OS X */ 
    5 static int dummy ATTRIBUTE((unused,used)) = 0; 
     4MPIU_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING; 
    65 
    76#if defined(HAVE_VMSPLICE) 
  • mpich2/trunk/src/pm/hydra/configure.in

    r4531 r4551  
    4141# Check for special types 
    4242AC_TYPE_SIZE_T 
     43PAC_C_GNU_ATTRIBUTE 
    4344 
    4445dnl Check for necessary functions 
  • mpich2/trunk/src/pm/hydra/css/utils/cssu_tmp.c

    r4224 r4551  
    77#include "hydra_base.h" 
    88#include "cssi.h" 
     9 
     10/* This is here to suppress the "has no symbols" warning on OS X. See 
     11 * the MPIU_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING macro in mpiutil.h for 
     12 * more information. */ 
     13static int dummy ATTRIBUTE((unused,used)) = 0; 
  • mpich2/trunk/src/pm/hydra/include/hydra_base.h

    r4546 r4551  
    166166#define dprintf(...) 
    167167 
     168#ifndef ATTRIBUTE 
     169#ifdef HAVE_GCC_ATTRIBUTE 
     170#define ATTRIBUTE(a_) __attribute__(a_) 
     171#else 
     172#define ATTRIBUTE(a_) 
     173#endif 
     174#endif 
     175 
    168176struct HYD_Thread_context { 
    169177    pthread_t thread; 
  • mpich2/trunk/src/pm/hydra/pm/utils/pmi.c

    r4156 r4551  
    44 *      See COPYRIGHT in top-level directory. 
    55 */ 
     6 
     7#include "hydra_base.h" 
     8/* This is here to suppress the "has no symbols" warning on OS X. See 
     9 * the MPIU_SUPPRESS_OSX_HAS_NO_SYMBOLS_WARNING macro in mpiutil.h for 
     10 * more information. */ 
     11static int dummy ATTRIBUTE((unused,used)) = 0;