Tru64 Pragmas; Unnamed Struct/Union Fields Within Structs/Unions - Red Hat ENTERPRISE LINUX 3 - USING GCC Using Instructions

Using the gnu compiler collection (gcc)
Hide thumbs Also See for ENTERPRISE LINUX 3 - USING GCC:
Table of Contents

Advertisement

206
redefine_extname
This pragma gives the C function
appear before the function declaration. This pragma is equivalent to the asm labels extension
(refer to Section 6.39 Controlling Names Used in Assembler Code). The preprocessor defines
__PRAGMA_REDEFINE_EXTNAME

6.48.3. Tru64 Pragmas

For compatibility with the Compaq C compiler, the following pragma is supported.
extern_prefix
string
This pragma renames all subsequent function and variable declarations such that
prepended to the name. This effect may be terminated by using another
with the empty string.
This pragma is similar in intent to to the asm labels extension (refer to Section 6.39 Controlling
Names Used in Assembler Code) in that the system programmer wants to change the
assembly-level ABI without changing the source-level API. The preprocessor defines
__PRAGMA_EXTERN_PREFIX
6.49. Unnamed struct/union fields within structs/unions.
For compatibility with other compilers, GCC allows you to define a structure or union that contains,
as fields, structures and unions without names. For example:
struct {
int a;
union {
int b;
float c;
};
int d;
} foo;
In this example, the user would be able to access members of the unnamed union with code like
. Note that only unnamed structs and unions are allowed, you may not have, for example, an
foo.b
unnamed
.
int
You must never create such structures that cause ambiguous field definitions. For example, this struc-
ture:
struct {
int a;
struct {
int a;
};
} foo;
It is ambiguous which
be avoided. In the future, such constructs may be detected and treated as compilation errors.
oldname newname
oldname
if the pragma is available.
if the pragma is available.
is being referred to with
a
Chapter 6. Extensions to the C Language Family
the assembler label
. Such constructs are not supported and must
foo.a
. The pragma must
newname
string
extern_prefix
is
pragma

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 3 - USING GCC and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Enterprise linux 3

Table of Contents