GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PBI / dev > doc_gather / linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

Attribute.h File Reference

Defines the __attribute__ feature to disappear on non-GCC platforms. More...


Defines

#define __attribute__(x)
 With non-GCC compilers, the __attribute__ feature is redefined as a NOP macro. With GCC compilers, this macro is not defined.
#define ATTR_UNUSED_OK   __attribute__((unused))
 Symbol defined when using GCC compilers indicating that a static variable or static function is okay to be unused.


Detailed Description

Defines the __attribute__ feature to disappear on non-GCC platforms.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: Attribute.h,v 1.3 2005/10/01 00:33:25 russell Exp $

SYNOPSIS
The GCC compiler allows functions, variables and types to assume various attributes through the appropriately named compiler feature called __attribute__. They were kind enough to define its usage in such a way that it can be easily #define'd into oblivion on non-GCC compilers. That's what this file does.
USAGE
The underlying directive can be used directly as in the following example
   static void my_unused_routine (void) __attribute__((unused));

Note the use of two sets of parens in this macro. It is this trick that allows one to easily #define this directive away on platforms that do not support it.
One can also use the short-hand symbol ATTR_UNUSED_OK as in,
   static void my_unused_routine (void) ATTR_UNUSED_OK;

TARGET PLATFORMS
All FSW supported platforms.

Define Documentation

#define ATTR_UNUSED_OK   __attribute__((unused))

Symbol defined when using GCC compilers indicating that a static variable or static function is okay to be unused.

With compiler warnings at their highest level, static variables and functions that are declared/defined but not used result in a warning message. Usually this is exactly what you want, it warns one of dead code or possible typos. However an include file that defines many static inlines can cause needless noise. It is unlikely that the user will need all the defined inlines, so some are bound to be unused.

Example:

   static inline int foo (int bar) ATTR_UNUSED_OK;


Generated on Thu Aug 4 14:20:46 2011 by  doxygen 1.5.8