Differences between neuron c and ansi c – Echelon Neuron C User Manual
Page 25

Neuron C Programmer’s Guide
13
Differences between Neuron C and ANSI C
Neuron C adheres closely to the ANSI C language standard; however, Neuron C
is not a "conforming implementation" of Standard C, as defined by the American
National Standards Institute committee X3-J11.
The following list outlines the major differences between Neuron C and ANSI C:
• Neuron C does not support floating-point computation with C syntax or
operators. However, a floating-point library is provided to allow use of
floating-point data that conforms to the IEEE 754 standard.
• ANSI C defines a short int as 16 bits or more and a long int as 32 bits or
more. Neuron C defines a short int as 8 bits and a long int as 16 bits. In
Neuron C, int defaults to a short int. A 32-bit signed integer library is
available to allow use of 32-bit quantities.
• Neuron C does not support the register or volatile classes. These storage
classes can be specified but are ignored.
• Neuron C does not implement initializers in declarations of automatic
variables.
• Neuron C does not support structures or unions as procedure parameters
or as function return values.
• Neuron C does not support declaration of bitfields as members of unions.
However, an equivalent declaration can be accomplished by defining a
structure as a member of the union, where the structure contains the
bitfields.
• Network variable structures cannot contain pointers. Configuration
property structures also cannot contain pointers.
• Pointers to timers, to message tags, or to I/O objects are not supported.
• Pointers to network variables, configuration properties, and EEPROM
variables are treated as pointers to constants (that is, the contents of the
variable referenced by the pointer can be read, but not modified). Under
special circumstances, and with certain restrictions, the pointers can be
used to modify the memory. See the discussion of the eeprom_memcpy( )
function in Chapter 8,
, on page 173, and also in the
Functions
chapter of the
Neuron C Reference Guide
. Also refer to the
discussion of the #pragma relaxed_casting_on compiler directive in the
Compiler Directives
chapter of the
Neuron C Reference Guide
.
• Macro arguments are not rescanned until after the macro is expanded,
thus the macro operators # and ## might not yield results as defined in
the ANSI C standard when they occur in nested macro expansions.
• Names of network variables and message tags are limited to 16
characters. Names of functional blocks are limited to 16 characters
unless they are declared using the external_name feature, in which case
the external name is limited to 16 characters, and the internal name of
the functional block is limited to 64 characters.
• A few ANSI C library functions are included in Neuron C, such as
memcpy( ) and memset( ). A string and byte operation library is provided
to allow use of a subset of the ANSI C functions defined in the