Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

clang++ needs to probe for ALIGNOF(type) #844

Closed
rurban opened this Issue · 2 comments

1 participant

@rurban
Collaborator

clang++ fails at datatype.h by using anonymous structs in the ALIGNOF ie. offsetof builtin.
The ALIGNOF values need to probed beforehand unfortunately.
Even a named struct is disallowed in the ALIGNOF macro.

Work is done in rurban/clang++-gh844

@rurban
Collaborator

Errors:
=> anonymous struct at ./include/parrot/datatypes.h can not be defined in a type specifier.

or when not anonymous:

#define ALIGNOF(name,x) offsetof(struct _offset_##name##_t {char c; x d;}, d)
ALIGNOF(intval,INTVAL)

=> error: '_offset_intval_t' can not be defined in a type specifier

@rurban rurban was assigned
@rurban rurban referenced this issue from a commit
@rurban rurban [GH #844] Add clang++ support, new auto::alignof step
clang++ does not allow struct definitions inside a type specifier,
offsetof() in datatypes.h
Thus probe for clang++ only for all ALIGNOF values in a
new auto::alignof step. This is normally skipped. Add the
definitions to feature.h.
59b678a
@rurban rurban referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@rurban rurban referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@rurban rurban referenced this issue from a commit
@rurban rurban [GH #844] Make gziphandle C++ safe
Wrap #include <zlib.h> into PMC_HEADER_PREAMBLE to be able to use
ATTR gzFile file. This is now C++ safe and clang++ compiles fine.
fdd0ca3
@rurban rurban referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@rurban rurban referenced this issue from a commit
@rurban rurban [GH #844] fix clang++ attributes, set -x c++ in cc
clang++ prints always a warning on c sources.
Move -x c++ from warnings upfront to cc, probed in auto::gcc
to be able to correctly probe for warnings and attributes.
This fixed almost all clang++ warnings, only dynoplibs
-Wno-parentheses-equality is missing for those.
1a2f59b
@rurban rurban referenced this issue from a commit
@rurban rurban [GH #844] add missing auto::alignof files
Add files to MANIFEST
Use auto::alignof as last auto step
665f7d5
@rurban rurban referenced this issue from a commit
@rurban rurban [GH #844] Probe for valid offsetof in structs (clang++)
Before we hardcoded clang++ as only compiler which does not compile
struct definitions inside a type specifier, offsetof() in datatypes.h.
Probe now for this behavior, and set HAS_COMPILER_OFFSETOF_ALIGNOF.
1 if allowed at compile-time, and undef if not and various
PARROT_ALIGN_<type> definitions are precomputed.

Also fix parrot/datatypes.h codingstd.
3fb8675
@rurban rurban referenced this issue from a commit
@rurban rurban [GH #844] use $conf->data->{cc} for clang++ as it has -x c++ added
This enables proper clang++ warnings.
df26e9a
@rurban rurban referenced this issue from a commit
@rurban rurban [GH #844] Improve makefile rules
Add clang suffix overrides or dynoplibs (-Wno-parentheses-equality)
Improve the DYNOPLIBS defines.
e6c9077
@rurban
Collaborator

Merged rurban/clang++-gh844 with 9b4f7ab

Tested on linux with gcc,g++,clang and clang++, solaris cc and windows msvc

@rurban rurban closed this
@rurban rurban referenced this issue from a commit
@rurban rurban [GH #844] Add ChangeLog entry
And improve a couple of others.
9b4f7ab
@rurban rurban referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@rurban rurban referenced this issue from a commit
@rurban rurban [GH #844] Improve Configure steps reporting
Currently we have "yes"/"no", sometimes "done", "skipped" and some
steps report more.  Library checks report "no" or "yes, version".

This improve at least the library steps, which can be omitted
with --without-lib to print "skipped" instead of "no".
no could mean not requested or not found.
"not requested" (llvm) is harmonized to "skipped".

"done" is for steps with no other results than done.
c3b98ce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.