Permalink
Browse files

[GH #844] use $conf->data->{cc} for clang++ as it has -x c++ added

This enables proper clang++ warnings.
  • Loading branch information...
1 parent 3fb8675 commit df26e9a1612cb4ec5d1242d9520b13b8034cac24 @rurban rurban committed Sep 26, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 config/auto/warnings.pm
@@ -70,10 +70,13 @@ us ensure that files we know are clean for a new warning stay clean.
'todo' functions just like never does, but it indicates that these
files are expected to eventually be free of this warning.
+'override' adds warnings to the end, to override previous warnings enabled
+by -Wall or -Wextra for example.
+
Note that there is no actual requirement that the 'file' be a full path
to a .c file; the file could be "PMCS" or "OPS" or some other identifier;
whatever the value, it will generate a Config entry prefixed with
-C<ccwarn::>, which will probably be used via @@ expansion in a makefile.
+C<ccwarn::>, which will be used via @@ expansion in a makefile.
It is tempting to put this into a config file, but having it in
perl gives us the ability to dynamically setup certain warnings based
@@ -325,7 +328,7 @@ sub runstep {
'-fvisibility=hidden';
};
if ($conf->data->get('clang') and $compiler eq 'g++') { # clang++
- $self->{'warnings'}{$compiler}{'override'} = {
+ $self->{'warnings'}{'g++'}{'override'} = {
'-Wno-parentheses-equality' => [ qw(
src/ops/core_ops.c
) ],
@@ -412,7 +415,7 @@ sub valid_warning {
$conf->debug("trying attribute '$warning'\n");
- my $cc = $conf->option_or_data('cc');
+ my $cc = $conf->data->get('cc');
$conf->cc_gen('config/auto/warnings/test_c.in');
my $ccflags = $conf->data->get('ccflags');

0 comments on commit df26e9a

Please sign in to comment.