GithubHelp home page GithubHelp logo

Comments (6)

jkeenan avatar jkeenan commented on July 30, 2024

#190 -- which is a cherry-pick of a patch from @rurban from 2 years ago -- appears to clear up most of these warnings. Here is my before/after comparison:

Effect of applying rurban patch 5599d1a in branch gpp-build-time-warnings-20210505

[perlmonger: devel-nytprof] $ ~/bin/perl/report-build-warnings gpp.master.output.txt
File:  gpp.master.output.txt

  Wliteral-suffix                           35
  Wwrite-strings                             3

[perlmonger: devel-nytprof] $ ~/bin/perl/report-build-warnings gpp.branch.output.txt
File:  gpp.branch.output.txt

  Wwrite-strings                             3

from devel-nytprof.

jkeenan avatar jkeenan commented on July 30, 2024

With one more commit to the gpp-build-time-warnings-20210505 branch (#190), we can reduce the remaining number of g++ build-time warnings from 3 to 2.

 ~/bin/perl/report-build-warnings gpp.branch.output.2nd.txt
File:  gpp.branch.output.2nd.txt

  Wwrite-strings                             2

from devel-nytprof.

jkeenan avatar jkeenan commented on July 30, 2024

With release of CPAN version 6.10, 2 -Wwrite-strings build-time warnings remain when compiling with g++.

from devel-nytprof.

jkeenan avatar jkeenan commented on July 30, 2024

With release of CPAN version 6.10, 2 -Wwrite-strings build-time warnings remain when compiling with g++.

$ parse-build-warnings 5c915c93d2.freebsd.g++9.make.output.txt.gz 
File:  5c915c93d2.freebsd.g++9.make.output.txt.gz

[
  {
    char   => 37,
    group  => "Wwrite-strings",
    line   => 226,
    source => "NYTProf.xs",
    text   => "ISO C++ forbids converting a string constant to 'char*'",
  },
  {
    char   => 37,
    group  => "Wwrite-strings",
    line   => 231,
    source => "NYTProf.xs",
    text   => "ISO C++ forbids converting a string constant to 'char*'",
  },
]

from devel-nytprof.

jkeenan avatar jkeenan commented on July 30, 2024

My local and remote machines have been upgraded. Here is a status update on warnings emitted during make when compiling Devel-NYTProf (master branch) with the default versions of g++.

Ubuntu Linux 22.04 LTS

$ g++ --version | head -n 1
g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

$ report-build-warnings 2a11e63e8d.linux.g++-11.make.output.txt.gz 
File:  2a11e63e8d.linux.g++-11.make.output.txt.gz

  Wregister                                  4
  Wwrite-strings                             2

$ parse-build-warnings 2a11e63e8d.linux.g++-11.make.output.txt.gz 
File:  2a11e63e8d.linux.g++-11.make.output.txt.gz

[
  {
    char   => 37,
    group  => "Wwrite-strings",
    line   => 226,
    source => "NYTProf.xs",
    text   => "ISO C++ forbids converting a string constant to \xE2\x80\x98char*\xE2\x80\x99",
  },
  {
    char   => 37,
    group  => "Wwrite-strings",
    line   => 231,
    source => "NYTProf.xs",
    text   => "ISO C++ forbids converting a string constant to \xE2\x80\x98char*\xE2\x80\x99",
  },
  {
    char   => 28,
    group  => "Wregister",
    line   => 1281,
    source => "NYTProf.xs",
    text   => "ISO C++17 does not allow \xE2\x80\x98register\xE2\x80\x99 storage class specifier",
  },
  {
    char   => 18,
    group  => "Wregister",
    line   => 1407,
    source => "NYTProf.xs",
    text   => "ISO C++17 does not allow \xE2\x80\x98register\xE2\x80\x99 storage class specifier",
  },
  {
    char   => 28,
    group  => "Wregister",
    line   => 1408,
    source => "NYTProf.xs",
    text   => "ISO C++17 does not allow \xE2\x80\x98register\xE2\x80\x99 storage class specifier",
  },
  {
    char   => 28,
    group  => "Wregister",
    line   => 1409,
    source => "NYTProf.xs",
    text   => "ISO C++17 does not allow \xE2\x80\x98register\xE2\x80\x99 storage class specifier",
  },
]

FreeBSD-13

$ g++ --version | head -n 1
g++ (FreeBSD Ports Collection) 12.2.0

$ report-build-warnings 2a11e63e8d.freebsd.threaded.gcc12.make.output.tx
t.gz
File:  2a11e63e8d.freebsd.threaded.gcc12.make.output.txt.gz

  Wregister                                  4
  Wwrite-strings                             2

$ parse-build-warnings 2a11e63e8d.freebsd.threaded.gcc12.make.output.txt.gz 
File:  2a11e63e8d.freebsd.threaded.gcc12.make.output.txt.gz

[
  {
    char   => 37,
    group  => "Wwrite-strings",
    line   => 226,
    source => "NYTProf.xs",
    text   => "ISO C++ forbids converting a string constant to 'char*'",
  },
  {
    char   => 37,
    group  => "Wwrite-strings",
    line   => 231,
    source => "NYTProf.xs",
    text   => "ISO C++ forbids converting a string constant to 'char*'",
  },
  {
    char   => 28,
    group  => "Wregister",
    line   => 1281,
    source => "NYTProf.xs",
    text   => "ISO C++17 does not allow 'register' storage class specifier",
  },
  {
    char   => 18,
    group  => "Wregister",
    line   => 1407,
    source => "NYTProf.xs",
    text   => "ISO C++17 does not allow 'register' storage class specifier",
  },
  {
    char   => 28,
    group  => "Wregister",
    line   => 1408,
    source => "NYTProf.xs",
    text   => "ISO C++17 does not allow 'register' storage class specifier",
  },
  {
    char   => 28,
    group  => "Wregister",
    line   => 1409,
    source => "NYTProf.xs",
    text   => "ISO C++17 does not allow 'register' storage class specifier",
  },
]

So on both platforms g++ is now emitting -Wregister warnings related to C++17. Context (from the FreeBSD run):

NYTProf.xs: In function ‘int dopopcx_at(PerlInterpreter*, PERL_CONTEXT*, I32, UV)’:
NYTProf.xs:1281:28: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
 1281 |     register PERL_CONTEXT *cx;
      |                            ^~
NYTProf.xs: In function ‘PERL_CONTEXT* visit_contexts(PerlInterpreter*, UV, int (*)(PerlInterpreter*, PERL_CONTEXT*, UV*))’:
NYTProf.xs:1407:18: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
 1407 |     register I32 cxix = cxstack_ix;
      |                  ^~~~
NYTProf.xs:1408:28: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
 1408 |     register PERL_CONTEXT *cx = NULL;
      |                            ^~
NYTProf.xs:1409:28: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
 1409 |     register PERL_CONTEXT *ccstack = cxstack;
      |                            ^~~~~~~

I don't follow C++ development. Is there anyone who could shed some light on this?

from devel-nytprof.

jkeenan avatar jkeenan commented on July 30, 2024

The 4 -Wregister warnings should be gone as of version 6.13 of Devel-NYTProf, uploaded just now to CPAN. That should leave the 2 -Wwrite-strings warnings.

from devel-nytprof.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.