| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | | |
Before, we were doing C90, there was no official syntax for such attributes, and we used ours. With C99 we can use "ty [ attributes N ]" to print "array with attributes of N elements of type ty".
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Owing to the peculiarities of array types in Cutil.change_attributes_type, type-related attributes of the array element type were duplicated on the array type. E.g. elaborating 'const int a[10][5]' produced
"a is an array of 5 const arrays of 10 const ints"
instead of
"a is an array of 5 arrays of 10 const ints"
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The treatment of attributes in the current CompCert is often surprising. For example,
attribute(xxx) char * x;
is parsed as "x is a pointer to a (char modified by attribute "xxx")", while for most attributes (e.g. section attributes) the expected meaning is "x, modified by attribute "xxx", has type pointer to char".
CompCert's current treatment comes from the fact that attributes are processed very much like the standard type modifiers `const` and `volatile`, i.e.
const char * x;
is really "x is a pointer to a const char", not "x is a const pointer to char".
This experiment introduces a distinction between type-related attributes (which include the standard modifiers `const` and `volatile`) and other attributes. The other, non-type-related attributes are "floated up" during elaboration so that they apply to the variable or function being declared or defined. In the examples above,
attribute(xxx) char * x; // "attribute(xxx)" applies to "x"
const char * x; // "const" applies to "char"
This may be a step in the right direction but is not the final story. In particular, the `packed` attribute is special-cased when applied to `struct`, like it was before, and future attributes concerning calling conventions would need to be floated up to function types but not higher than that.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
The Printf is only needed for the identifier functions.
Furthermore the new intconst from Cutil is used to generate the
integer constant and shadowing of the open C is removed.
|
| | |
| | |
| | |
| | |
| | | |
The intconst function comes with an optional parameter to add an
hex string for later printing.
|
| | |
| | |
| | |
| | | |
The clashing identifiers are now referenced explicitly.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Locations are only used in two functions and can be referenced
there directly.
|
| | |
| | |
| | |
| | | |
The Locations are only used in one function.
|
| | |
| | |
| | |
| | | |
The two types needed from AST are prefixed directly.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
This avoids nameclashes with the Pervasives version of these
functions.
|
| | |
| | |
| | |
| | |
| | | |
Only two types from AST are needed and the global shadowing open
can be removed.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The Cabshelper is only used in 4 places, so we don't need a global
open. Furhtermore the String.t type is now inlined for Cabs to
avoid shadowing problems in Elab.ml
Bug 19872
|
| | |
| | |
| | |
| | |
| | |
| | | |
Format was only used in one place without explicit module prefix.
The same holds for Env.
Bug 19872
|
| | |
| | |
| | |
| | |
| | |
| | | |
Since anonymous struct members are kept in the fieldlist, the
fieldlist can never be empty in this case.
Bug 19872
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
This only means that there must be one identifier at the begining
and then a designator.
Bug 20765
|
|\ \ \
| | | |
| | | | |
Implement offsetof via builtin
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Instead of multiplying the array constant directly with the
size of the offset the cautious_mul function is used to detect
potential overflows.
Bug 20765
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Gcc and clang do not raise an error for this, also it should work
for the last array element which can be without size.
Bug 20765
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The c standard allows member designators for offsetof. The current
implementation works by recursively combining the offset of each
of the member designators. For array access the size of the
subtypes is multiplied by the index and for members the offset of
the member is calculated.
Bug 20765
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The problem was that sub structs are were not correctly aligned.
The new version is much simpler and uses the sizeof_struct to
calculate the individual offsets and add them up to get correct
offest.
Bug 20765
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The implementation of offsetof as macro in the form
((size_t) &((ty*) NULL)->member) has the problem that it cannot be
used everywhere were an integer constant expression is allowed,
for example in initiliazers of global variables and there is also
no check for the case that member is of bitifield type.
The new implementation adds a builtin function for this which is
replaced by an integer constant during elaboration.
Bug 20765
|
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | | |
The new Makefile variable LINK_OPT can be used to specify
additional linker flags for different operating systems, like
linking with setargv.obj under windows.
Bug 20871
|
| | |
| | |
| | |
| | | |
Follow-up to commit 1df1830
|
| | | |
|
| | |
| | |
| | |
| | | |
Those three functions can be useful to implement front-ends for languages other than C.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The new option -fdiagnostics-format allows it to switch between
the three different format version:
-ccomp (default) with file:line:
-vi with file+line:
-msvc with file(line):
Bug 19872
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Controls whether the [-Woption] is printed in the diagnostic
message for mappable warnings/errors.
Bug 19872
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The option -fmax-errors limits the number of errors that are
reported before the compilation is aborted. The default 0 means no
limit.
Bug 19872
|
| | | |
|