Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-X does not disable warning enabled by use v5.3{6,8} #21427

Closed
briandfoy opened this issue Aug 26, 2023 · 2 comments · Fixed by #21431
Closed

-X does not disable warning enabled by use v5.3{6,8} #21427

briandfoy opened this issue Aug 26, 2023 · 2 comments · Fixed by #21431

Comments

@briandfoy
Copy link
Member

Description

The -X should turn off all warnings, but does not suppress warnings enabled as part of use v5.36 or use v5.38.

Steps to Reproduce

$ perl5.36.1 -Mwarnings -X -E 'say 1 + "a"'
1

$ perl5.36.1 -Mv5.36 -X -E 'say 1 + "a"'
Argument "a" isn't numeric in addition (+) at -e line 1.
1

$ perl5.38.0 -Mwarnings -X -E 'say 1 + "a"'
1

$ perl5.38.0 -Mv5.38 -X -E 'say 1 + "a"'
Argument "a" isn't numeric in addition (+) at -e line 1.
1

Expected behavior

There are no warnings under -X

Perl configuration

Summary of my perl5 (revision 5 version 38 subversion 0) configuration:
   
  Platform:
    osname=darwin
    osvers=22.6.0
    archname=darwin-2level
    uname='darwin m2otter.local 22.6.0 darwin kernel version 22.6.0: wed jul 5 22:21:53 pdt 2023; root:xnu-8796.141.3~6release_arm64_t6020 arm64 '
    config_args='-des -Dprefix=/usr/local/perls/perl-5.38.0'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
  Compiler:
    cc='cc'
    ccflags ='-fno-common -DPERL_DARWIN -mmacosx-version-min=13.5 -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    optimize='-O3'
    cppflags='-fno-common -DPERL_DARWIN -mmacosx-version-min=13.5 -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='Apple LLVM 14.0.3 (clang-1403.0.22.14.1)'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=8
    longdblkind=0
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='cc'
    ldflags =' -mmacosx-version-min=13.5 -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/lib /Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/lib /Library/Developer/CommandLineTools/usr/lib /usr/lib
    libs= 
    perllibs=
    libc=
    so=dylib
    useshrplib=false
    libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=bundle
    d_dlsymun=undef
    ccdlflags=' '
    cccdlflags=' '
    lddlflags=' -mmacosx-version-min=13.5 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector-strong'


Characteristics of this binary (from libperl): 
  Compile-time options:
    HAS_LONG_DOUBLE
    HAS_STRTOLD
    HAS_TIMES
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_HASH_FUNC_SIPHASH13
    PERL_HASH_USE_SBOX32
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    PERL_USE_SAFE_PUTENV
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
  Built under darwin
  Compiled at Aug  5 2023 01:46:29
  %ENV:
    PERL="/Users/brian/bin/perls/perl-latest"
    PERL5_PATH="/Users/brian/bin/perls"
  @INC:
    /usr/local/perls/perl-5.38.0/lib/site_perl/5.38.0/darwin-2level
    /usr/local/perls/perl-5.38.0/lib/site_perl/5.38.0
    /usr/local/perls/perl-5.38.0/lib/5.38.0/darwin-2level
    /usr/local/perls/perl-5.38.0/lib/5.38.0

@jkeenan
Copy link
Contributor

jkeenan commented Aug 26, 2023

Description

The -X should turn off all warnings, but does not suppress warnings enabled as part of use v5.36 or use v5.38.

This must reflect a change between 5.34 and 5.36.

$ perl -v | head -2 | tail -1
This is perl 5, version 34, subversion 0 (v5.34.0) built for x86_64-linux
$ perl -Mwarnings -X -E 'say 1 + "a"'
1
$ perl -Mv5.34 -X -E 'say 1 + "a"'
1

For context, here's what perldoc perlrun says in 5.38.0:

    -X   Disables all warnings regardless of "use warnings" or $^W. See
         warnings.

         Forbidden in "PERL5OPT".

I'm confirming @briandfoy's bug report, but not (yet) taking any position on what is to be done.

@Leont
Copy link
Contributor

Leont commented Aug 27, 2023

This must reflect a change between 5.34 and 5.36.

Yes, «use 5.036» is the first to enable warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants