In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/a730e3f230f364cffe49370f816f975ae7c9c403?hp=10c25cd94120c0e509e5ce54480c24d08281e090>
- Log ----------------------------------------------------------------- commit a730e3f230f364cffe49370f816f975ae7c9c403 Author: Jarkko Hietaniemi <[email protected]> Date: Thu Sep 4 09:08:33 2014 -0400 Use sizeof() in UNUSED_ARG and UNUSED_VAR to avoid accessing the values. The values might even be uninitialized in the case of PERL_UNUSED_VAR. M perl.h commit 2313e9ca3be65223d835c40b25c76765e8c35547 Author: Jarkko Hietaniemi <[email protected]> Date: Thu Sep 4 08:22:34 2014 -0400 Grab the warnflags and stdflags from cflags [perl #122694]. They become $Config{ccwarnflags} and $Config{ccstdflags}. M configpm commit d584a308cab484ee23984026d264bd447d452018 Author: Jarkko Hietaniemi <[email protected]> Date: Thu Sep 4 08:21:57 2014 -0400 Some <termios.h> #define WRAP, undef it. M time64.c ----------------------------------------------------------------------- Summary of changes: configpm | 18 ++++++++++++++++++ perl.h | 7 ++++--- time64.c | 1 + 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/configpm b/configpm index d5bf5f2..21bd3ef 100755 --- a/configpm +++ b/configpm @@ -628,6 +628,24 @@ foreach my $prefix (qw(libs libswanted)) { $heavy_txt .= "${prefix}_nolargefiles='$value'\n"; } +if (open(my $fh, "cflags")) { + my $ccwarnflags; + my $ccstdflags; + while (<$fh>) { + if (/^warn="(.+)"$/) { + $ccwarnflags = $1; + } elsif (/^stdflags="(.+)"$/) { + $ccstdflags = $1; + } + } + if (defined $ccwarnflags) { + $heavy_txt .= "ccwarnflags='$ccwarnflags'\n"; + } + if (defined $ccstdflags) { + $heavy_txt .= "ccstdflags='$ccstdflags'\n"; + } +} + $heavy_txt .= "EOVIRTUAL\n"; $heavy_txt .= <<'ENDOFGIT'; diff --git a/perl.h b/perl.h index 54a880e..de4374f 100644 --- a/perl.h +++ b/perl.h @@ -311,18 +311,19 @@ /* gcc -Wall: * for silencing unused variables that are actually used most of the time, - * but we cannot quite get rid of, such as "ax" in PPCODE+noargs xsubs + * but we cannot quite get rid of, such as "ax" in PPCODE+noargs xsubs, + * or variables/arguments that are used only in certain configurations. */ #ifndef PERL_UNUSED_ARG # if defined(lint) && defined(S_SPLINT_S) /* www.splint.org */ # include <note.h> # define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x)) # else -# define PERL_UNUSED_ARG(x) ((void)x) +# define PERL_UNUSED_ARG(x) ((void)sizeof(x)) # endif #endif #ifndef PERL_UNUSED_VAR -# define PERL_UNUSED_VAR(x) ((void)x) +# define PERL_UNUSED_VAR(x) ((void)sizeof(x)) #endif #if defined(USE_ITHREADS) || defined(PERL_GLOBAL_STRUCT) diff --git a/time64.c b/time64.c index 74914bd..b7ced91 100644 --- a/time64.c +++ b/time64.c @@ -88,6 +88,7 @@ static const char dow_year_start[SOLAR_CYCLE_LENGTH] = { #define CHEAT_YEARS 108 #define IS_LEAP(n) ((!(((n) + 1900) % 400) || (!(((n) + 1900) % 4) && (((n) + 1900) % 100))) != 0) +#undef WRAP /* some <termios.h> define this */ #define WRAP(a,b,m) ((a) = ((a) < 0 ) ? ((b)--, (a) + (m)) : (a)) #ifdef USE_SYSTEM_LOCALTIME -- Perl5 Master Repository
