gccattributes.html (1402B)
1 <html> 2 <head> 3 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 5 <meta http-equiv="Content-Language" content="en" /> 6 <title>skalibs: the gccattributes header</title> 7 <meta name="Description" content="skalibs: the gccattributes header" /> 8 <meta name="Keywords" content="skalibs header gccattributes gcc attributes" /> 9 <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> --> 10 </head> 11 <body> 12 13 <p> 14 <a href="index.html">libstddjb</a><br /> 15 <a href="../libskarnet.html">libskarnet</a><br /> 16 <a href="../index.html">skalibs</a><br /> 17 <a href="//skarnet.org/software/">Software</a><br /> 18 <a href="//skarnet.org/">skarnet.org</a> 19 </p> 20 21 <h1> The <tt>skalibs/gccattributes.h</tt> header </h1> 22 23 <p> 24 <tt>skalibs/gccattributes.h</tt> is a set of wrappers around 25 <a href="https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html">gcc 26 attributes</a> (duh). It defines macros that are always valid, and 27 that have no effect if the compiler is not gcc or the used version 28 of gcc does not support the wanted attribute. 29 </p> 30 31 <p> 32 For instance: 33 </p> 34 35 <pre> 36 extern size_t str_len (char const *) gccattr_pure ; 37 </pre> 38 39 <p> 40 defines the <tt>str_len</tt> function as <em>pure</em> if it is 41 supported. 42 </p> 43 44 <p> 45 The source code is self-explanatory. 46 </p> 47 48 </body> 49 </html>