[bitlug] gcc c extensions - useful attributes

  • From: Turuvanur Pavan-A20404 <pavan.tc@xxxxxxxxxxxx>
  • To: "Bitlug (E-mail)" <bitlug@xxxxxxxxxxxxx>
  • Date: Fri, 3 Sep 2004 11:24:18 +0530

Hi,

found some really useful gcc attributes, most of which have abundant
usage in critical systems s/w.
 
Here is a link that lists them.
http://www.ohse.de/uwe/articles/gcc-attributes.html#func-section

Also, here is an example of one of its usage:

$KERNEL_SRC_DIR/include/linux/init.h :
#define __init  __attribute__((__section__(".init.text")))
 
__init is used as a function attribute. Examples are init_module,
which is the starting point (called by insmod) for any device
driver in linux. 
 
check out what "section" does, in the above mentioned link.
 
Pavan

Other related posts:

  • » [bitlug] gcc c extensions - useful attributes