Go to the first, previous, next, last section, table of contents.


4.4 Pragmas

C++ pragmas and gcc/g++ attribute declarations are ignored by Larch/C++. They have the following syntax. The first form of pragma must look like a C++ macro definition in the sense that the # can only be preceded on its line by whitespace.

pragma ::= # non-nl-white-space pragma [ non-newline ] ...
         | __attribute__ [ non-semi-newline ] ...
         | __asm__ | __const__ | __inline__
         | __signed__ | __typeof__ | __volatile__
         | __extension__
non-semi-newline ::= any character except a semicolon (;) or newline

In the following, the text ignored by Larch/C++ is described in the comments.

// @(#)$Id: pragmas.lh,v 1.2 1997/06/03 20:30:17 leavens Exp $
#pragma optimize(speed)              // this line ignored
typedef int _G_int8_t
 __attribute__((__mode__(__QI__)));  // this line ignored up to the ;
extern void default_error_handler(const char*)
 __attribute__ ((noreturn));         // this line ignored up to the ;
 __const__ unsigned char * pos;      // the __const__ is ignored;
static __inline__ void foo();        // the __inline__ is ignored;


Go to the first, previous, next, last section, table of contents.