The env target allows the nesC compiler to be configured for a new platform without requiring source code changes. It allows specification of a target's data layout rules.
If -fnesc-target=env option is passed to nescc, the compilation uses a machine specification described in the environment variable NESC_MACHINE, such as
export NESC_MACHINE="long_double=8,4"
A particular order to the keynames in NESC_MACHINE is not necessary. The table below is a complete list of possible key names for NESC_MACHINE, a short description of their values, and their default if unspecified:
Keyname Value Default
pcc_bitfield_type_matters bool false
empty_field_boundary bit align 8
structure_size_boundary bit align 8
word_size size 1
pointer size,align 2,1
float size,align 4,1
double size,align 4,1
long_double size,align 4,1
short size,align 2,1
int size,align 2,1
long size,align 4,1
long_long size,align 8,1
int1248_align align,align,align,align 1,1,1,1
wchar_size_size size,size 2,2
char_wchar_signed bool,bool true,true
async_functions string empty
For reference and easy cut+paste, here is the full default specification for NESC_MACHINE:
export NESC_MACHINE="pcc_bitfield_type_matters=false word_size=1 pointer=2,1 float=4,1 double=4,1 long_double=4,1 short=2,1 int=2,1 long=4,1 long_long=8,1 int1248_align=1,1,1,1 wchar_size_size=2,2 char_wchar_signed=true,true empty_field_boundary=8 structure_size_boundary=8"
The curiously named wchar_size_size is the sizes of wchar_t and size_t respectively. See the gcc internal documentation (`info gccint') for more information on pcc_bitfield_type_matters, empty_field_boundary and structure_size_boundary.