This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81333] Bad alignment of global variables on Alpha
- From: "mikulas at artax dot karlin.mff.cuni.cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 06 Jul 2017 00:34:52 +0000
- Subject: [Bug target/81333] Bad alignment of global variables on Alpha
- Auto-submitted: auto-generated
- References: <bug-81333-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81333
--- Comment #3 from mikulas at artax dot karlin.mff.cuni.cz ---
> Only C11 and above. C99 and C98 does not have any requirements like that :)
Accessing any variable with the char pointer is allowed in C89 and newer
standards. Threading is not covered at all in C89 and C99.
See this quote from C89:
A.6.2 Undefined behavior:
* An object has its stored value accessed by an lvalue that does not have one
of the following types: the declared type of the object, a qualified version of
the declared type of the object, the signed or unsigned type corresponding to
the declared type of the object, the signed or unsigned type corresponding to a
qualified version of the declared type of the object, an aggregate or union
type that (recursively) includes one of the aforementioned types among its
members, or a character type ($3.3).