diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 130123c3..a5b8e5ed 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,7 +13,7 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 562, + BUILD_REVISION => 563, BUILD_DATE => "2014-05-01", }; diff --git a/modules/compiler_vm/compiler_vm_client.pl b/modules/compiler_vm/compiler_vm_client.pl index b2a78608..588db686 100755 --- a/modules/compiler_vm/compiler_vm_client.pl +++ b/modules/compiler_vm/compiler_vm_client.pl @@ -24,9 +24,9 @@ my $unshift_last_code = 0; my $only_show = 0; my %languages = ( - 'C11' => "gcc -std=c11 -pedantic -Wall -Wextra -Wno-unused -Wfloat-equal -Wfatal-errors", - 'C99' => "gcc -std=c99 -pedantic -Wall -Wextra -Wno-unused -Wfloat-equal -Wfatal-errors", - 'C89' => "gcc -std=c89 -pedantic -Wall -Wextra -Wno-unused -Wfatal-errors", + 'C11' => "gcc -std=c11 -pedantic -Wall -Wextra -Wno-unused -Wfloat-equal -Wshadow -Wfatal-errors", + 'C99' => "gcc -std=c99 -pedantic -Wall -Wextra -Wno-unused -Wfloat-equal -Wshadow -Wfatal-errors", + 'C89' => "gcc -std=c89 -pedantic -Wall -Wextra -Wno-unused -Wfloat-equal -Wshadow -Wfatal-errors", ); my %preludes = ( @@ -637,10 +637,17 @@ $got_paste = 1 and $extracted_args .= "-paste " if $code =~ s/(?<=\s)*-paste\s*/ my $got_nomain = undef; $got_nomain = 1 and $extracted_args .= "-nomain " if $code =~ s/(?<=\s)*-nomain\s*//i; +my $include_args = ""; +while($code =~ s/-include\s+(\S+)\s+//) { + $include_args .= "#include <$1> "; +} + my $args = ""; $args .= "$1 " while $code =~ s/^\s*(-[^ ]+)\s*//; $args =~ s/\s+$//; +$code = "$include_args$code"; + if($save_last_code) { if($unshift_last_code) { unshift @last_code, $extracted_args . (length $args ? $args . ' ' . $code : $code); @@ -1048,7 +1055,7 @@ if($output =~ m/^\s*$/) { $output =~ s/<'(.*)' = char>/<'$1' = int>/g; $output =~ s/= (-?\d+) ''/= $1/g; $output =~ s/, //g; - $output =~ s/\s*warning: shadowed declaration is here \[-Wshadow\]//g; + $output =~ s/\s*warning: shadowed declaration is here \[-Wshadow\]//g unless $got_paste or $got_run eq 'paste'; $output =~ s/preprocessor macro>\s+/preprocessor macro>/g; $output =~ s/\s*//g; $output =~ s/cc1: all warnings being treated as; errors//g; diff --git a/modules/compiler_vm/compiler_vm_server.pl b/modules/compiler_vm/compiler_vm_server.pl index 216bd728..e6568cb4 100755 --- a/modules/compiler_vm/compiler_vm_server.pl +++ b/modules/compiler_vm/compiler_vm_server.pl @@ -8,7 +8,7 @@ my $USE_LOCAL = defined $ENV{'CC_LOCAL'}; my %languages = ( 'C89' => { 'cmdline' => 'gcc $file $args -o prog -ggdb -g3', - 'args' => '-Wextra -Wall -Wno-unused -std=gnu89 -lm -Wfatal-errors', + 'args' => '-Wextra -Wall -Wno-unused -std=gnu89 -lm -Wfloat-equal -Wshadow -Wfatal-errors', 'file' => 'prog.c', }, 'C++' => { @@ -18,12 +18,12 @@ my %languages = ( }, 'C99' => { 'cmdline' => 'gcc $file $args -o prog -ggdb -g3', - 'args' => '-Wextra -Wall -Wno-unused -pedantic -Wfloat-equal -std=c99 -lm -Wfatal-errors', + 'args' => '-Wextra -Wall -Wno-unused -pedantic -Wfloat-equal -Wshadow -std=c99 -lm -Wfatal-errors', 'file' => 'prog.c', }, 'C11' => { 'cmdline' => 'gcc $file $args -o prog -ggdb -g3', - 'args' => '-Wextra -Wall -Wno-unused -pedantic -Wfloat-equal -std=c11 -lm -Wfatal-errors', + 'args' => '-Wextra -Wall -Wno-unused -pedantic -Wfloat-equal -Wshadow -std=c11 -lm -Wfatal-errors', 'file' => 'prog.c', }, );