| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Having both looks like it ought to cause the build to fail, as with -std=c99
second it will override any previous -std=gnu99, and some platforms need the
former to both compile C99 code and have correct includes during Configure
probing.
However testing on those platforms without this change doesn't show any
errors. So this change doesn't seem to strictly be necessary. But it does
prevent our generated compiler command lines having contradictory flags,
and hence looking daft.
|
|
|
|
|
|
| |
Probe to see whether we need -std=gnu99 or -std=c99 to get C99 code to
compile. In cflags.SH, remove code that added gcc warning flags that were
compatible with C89 but are not compatible with C99.
|
|
|
|
|
| |
C11 makes them optional, and MSVC doesn't support them. We can't use them
(but even if we could, we should not).
|
| |
|
|
|
|
|
|
|
|
| |
declaration after statement is normal for C++ and C++ compilers
rightly complain if we try to warn (or error) on them, so don't
try to.
fixes #17353
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I got a notice from Jeff Law <law@redhat.com>:
Your particular package fails its testsuite. This was ultimately
tracked down to a Configure problem. The perl configure script treated
gcc-10 as gcc-1 and turned on -fpcc-struct-return. This is an ABI
changing flag and caused Perl to not be able to interact properly with
the dbm libraries on the system leading to a segfault.
His proposed patch corrected only this one instance of the version
mismatch. Reading the Configure script revealed more issues. This
patch fixes all of them I found.
Please note I do not have GCC 10 available, I tested it by faking the version
with:
--- a/Configure
+++ b/Configure
@@ -4672,7 +4672,7 @@ $cat >try.c <<EOM
int main() {
#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
#ifdef __VERSION__
- printf("%s\n", __VERSION__);
+ printf("%s\n", "10.0.0");
#else
printf("%s\n", "1");
#endif
|
|
|
|
| |
This requires newer metaconfig units that also rely on C89 <limits.h>.
|
| |
|
|
|
|
|
|
|
|
| |
The Configure changes here were generated using a version of metaconfig
that copies U/modified/i_stdlib.U from dist/U/vaproto.U, and changes it to
unconditionally define the i_stdlib Configure variable. That variable is
used by a large number of other Configure units, so it's not actually
practical to try and remove the relevant unit entirely.
|
| |
|
| |
|
|
|
|
| |
The core is already clean for this.
|
|
|
|
|
| |
Using the shell "case" statement rather than grep(1) will save a process on
every core C file compiled.
|
| |
|
|
|
|
| |
(follow-up to bdc795f4, suggested by Aaron Crane)
|
|
|
|
|
|
|
| |
With this change there is no need to explicitly e.g.
Configure ... -Accflags='-Wthread-safety'
since doing just -Dusethreads with recent enough clang
will automatically add the -Wthread-safety
|
|
|
|
|
| |
Fixes a problem introduced by 57d2761b where ccflags contents
with quotes got broken by the quotes getting stripped.
|
| |
|
|
|
|
| |
This reverts commit 0d55a45a6f024919f13cbe70fc861f5eb6d757ee.
|
|
|
|
|
|
|
|
| |
(1) It doesn't mean "strict C89" on its own, -pedantic would also be needed.
(2) Using C99 features like long long or inline becomes harder.
The downside of this change is that C99-isms can more easily
creep into the core code, breaking it for non-gcc C89 compilers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
% cat ~/t.pl
print ( (q{foo'} =~ /[^']+'/) ? "ok\n" : "not ok\n" );
% perl ~/t.pl
ok
% ./miniperl ~/t.pl
not ok
This only happens with -fPIC -ftree-vrp builds.
It is a regression from gcc-4.8.
Bug-Debian: http://bugs.debian.org/754054
Patch-Name: debian/regcomp-mips-optim.diff
|
| |
|
|
|
|
|
|
| |
Logical revert of b679cac0, but redone.
Apple versions only for now; situation on Linux side unknown.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The core was already -pedantic clean (with default config, with
DEBUGGING almost), cflags just needed some juggling, somewhat
complicated by the logic of -Werror=declaration-after-statement.
Still requires -Dgccansipedantic to enable the -pedantic because
otherwise we do not use things like gcc brace groups and C99 variadic
macros, which are nice. Also, see below about usedtrace complications.
(the gccansipedantic logic was odd, probably not used for a while.)
Under -DDEBUGGING the -pedantic requires quieting the warnings
about overlong string literals.
Disable -pedantic et al if usedtrace is enabled, it uses too many
non-standard features (and it depends on code generated by an external
framework).
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Has been AFAICT for years / always, the documentation just
had it wrong in pre-4.0 gccs.
|
|
|
|
|
| |
For C89 compliancy, this is the most common thinko people make.
While waiting for -pedantic -std=c89, which will catch the same.
|
| |
|
|
|
|
| |
"clean" as in "not needed anymore".
|
|
|
|
|
|
| |
Another possibility is that clang has become smarter,
and that needs to be made dependent on clang version.
But for now, let's opt for simplicity and less logic.
|
| |
|
|
|
|
|
|
|
|
| |
(Except for the possible toke_cflags customizations.)
Do the -Wno-unused-... edits only if -Wall.
Echo the edits done during extraction time, to make the magic more visible.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- after return/croak/die/exit, return/break are pointless
(break is not a terminator/separator, it's a goto)
- after goto, another goto (!) is pointless
- in some cases (usually function ends) introduce explicit NOT_REACHED
to make the noreturn nature clearer (do not do this everywhere, though,
since that would mean adding NOT_REACHED after every croak)
- for the added NOT_REACHED also add /* NOTREACHED */ since
NOT_REACHED is for gcc (and VC), while the comment is for linters
- declaring variables in switch blocks is just too fragile:
it kind of works for narrowing the scope (which is nice),
but breaks the moment there are initializations for the variables
(the initializations will be skipped since the flow will bypass
the start of the block); in some easy cases simply hoist the declarations
out of the block and move them earlier
Note 1: Since after this patch the core is not yet -Wunreachable-code
clean, not enabling that via cflags.SH, one needs to -Accflags=... it.
Note 2: At least with the older gcc 4.4.7 there are far too many
"unreachable code" warnings, which seem to go away with gcc 4.8,
maybe better flow control analysis. Therefore, the warning should
eventually be enabled only for modernish gccs (what about clang and
Intel cc?)
|
|
|
|
| |
"unknown warning option" (for -W...) or "unknown argument" (for -...).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current UNIX build system does a strange thing to generate the
appropriate command-line to compile a particular src file. It calls
the cflags shell script, which
1) echoes to stdout the command line needed to compile the specified
file (excluding the name of the src file itself), e.g.
cc -c -Dfoo -Wbar ...
2) echoes the same thing to stderr, prefixied with ' CCCMD ='
Make then does
`sh cflags foo.o` foo.c
the cflags output to stdout is captured by the backticks, and is used
by make as the command line to run (with the foo.c appended). This run is
silent. The output to stderr isn't captured, and gets displayed. So the
user sees:
$ make
`sh cflags foo.o` foo.c
CCCMD = cc -c -Dfoo -Wbar ...
...
This is annoying for 2 reasons:
1) you don't get a simple command-line displayed which you could do a
simple cut and paste with (e.g. when you want to recompile a specific
source file, but alter the flags).
2) The make generates output on stderr, even when then there aren't any
errors. So "make 2>errs" can't be used to quickly spot warnings and
errors.
This commit fixes this by making cflags just output the cc command and
flags to stdout, then get Makefile to call it twice, once to echo
the command-line (on stdout), and once to execute it with backticks.
So the make output is now:
$ make
cc -c -Dfoo -Wbar ... foo.c
...
There is some stuff in Makefile.SH related to cross-compiling, which this
commit make have broken. Specifically the CCCMD and CCCMDSRC macros
have been changed in the normal case to remove backticks (and add them to
the make rules instead), but not for the cross compilation route.
The CC* defs in the cross-compilation case have a trailing -I$(CROSS_LIB)
outside of the backticks, which compilates matters.
However, in the subdir Cross/, there appears to be separate (and
divergent) copies of Makefile.SH and cflags, so maybe the files
I edited are no longer used for cross-compilation????
(followup: according to
<20131204170112.GA2490@iabyn.com>
the cross-compiling stuff I mentioned above has bit-rotted, and I don't
need to worry about it)
|
|
|
|
|
|
|
|
|
| |
These scripts had a mixture of old-style ':' comments and new-style
'#' comments. Since they have both, the old ones can't be needed for
portability reasons, so standardise on the modern form.
The old-style were just too confusing, especially as my syntax highlighter
didn't know about them.
|
|
|
|
|
|
| |
Add comments to the top of cflags.SH to explain what it does.
Also make it output comments at the top of the generated cflags
script explaining that its auto-generated.
|
|
|
|
|
| |
This went undetected for the longest time since most flags are
irrelevant at this point, but is vital if you are using --sysroot.
|
|
|
|
|
|
|
| |
We already have an exception for it when called as clang or clang-1.2.3,
but not when called as cc or anything else. Mac OS X Mountain Lion
therefore ends up spitting out lots of warnings, as cc is a symlink
to clang.
|
|
|
|
| |
clang++ or clang-3.2, ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This permits test code to include the perl headers for definitions without
creating a link dependency on the perl library (which may not exist yet).
Some of the static inline functions in inline.h reference functions in the
perl object files, and some compilers aren't smart enough to eliminate
unused static inline functions, hence including the inline.h in probe code
can cause link errors even though the probe code uses none of the functions
it declares. When probing, a failed link is taken as meaning that the
probed-for function is not present, as the assumption is that the link fails
because of it. Hence other causes of link failures cause the probing code to
generate incorrect results, and action (and bugs) at a distance.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add examples showing how to use cflags.SH to tweak the compiler flags used
for individual object files.
Previously cflags.SH contained a somewhat stale pre-canned list of file
basenames including removed files such as usersub (deleted before 5.000
shipped), and a partial list of 5.000 XS extensions. Whilst it's possible
to generate the correct list in cflags by parsing MANIFEST (and adding a few
fixups), it's still not actually *useful*, as cflags gets overwritten as
soon as config.sh changes. Hence the most end-user useful solution with
minimal maintenance is to eliminate the list entirely, and document how the
user should add to it as necessary.
|
| |
|
|
|
|
|
|
|
| |
All these files used to be executable in the release tarballs. Apparently things
also work without that in the repository, but I'd rather add this possibly
unecessary change to blead instead of breaking the upcoming release. This should
probably be looked into again afterwards.
|