HP C A.06.05 Reference Manual

Program Organization
Declarations
Chapter 2 23
Macro Names
Macro names do interfere with the other four name spaces. Therefore, when you specify a
macro name, do not use this name in one of the other four name spaces. For example, the
following program fragment is incorrect because it contains a macro named square and a
label named square:
#define square(arg) arg * arg
int main(void)
{
...
square:
...
}
Declarations within code
HP C has added the C9x feature which allows you to declare variables and types inside a
block of statements. This also allows declaration of new variables or types, such as expr_1,as
shown in the for statement below:
for(expr_1;expr_2;expr_3) statement_1
This new variable or type declared in expr_1 can be used in expr_2, expr_3 and statement_1.
NOTE The HP C/ANSI C compiler implementation of declarations within code is
similar to, but not identical to, the C++ implementation of declarations within
code.