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

Build-time warnings using g++ as compiler #191

Open
jkeenan opened this issue May 6, 2021 · 7 comments
Open

Build-time warnings using g++ as compiler #191

jkeenan opened this issue May 6, 2021 · 7 comments

Comments

@jkeenan
Copy link
Collaborator

jkeenan commented May 6, 2021

With a perl-5.32.1 compiled on FreeBSD with g++, I got these build-time errors when running make for Devel-NYTProf:

"/usr/home/jkeenan/testing/perl-5.32.1/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- NYTProf.bs blib/arch/auto/Devel/NYTProf/NYTProf.bs 644
"/usr/home/jkeenan/testing/perl-5.32.1/bin/perl" "/home/jkeenan/testing/perl-5.32.1-gpp/lib/5.33.9/ExtUtils/xsubpp"  -typemap '/home/jkeenan/testing/perl-5.32.1/lib/5.33.9/ExtUtils/typemap' -typemap '/usr/home/jkeenan/gitwork/devel-nytprof/typemap'  FileHandle.xs > FileHandle.xsc
mv FileHandle.xsc FileHandle.c
g++ -c    -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2 -O2 -pipe -fstack-protector -fno-strict-aliasing    -DVERSION=\"6.09_001\"  -DXS_VERSION=\"6.09_001\" -DPIC -fPIC "-I/home/jkeenan/testing/perl-5.32.1/lib/5.33.9/amd64-freebsd-thread-multi/CORE"  -DHAS_CLOCK_GETTIME -DHAS_ZLIB -DUSE_HARD_ASSERT -W -Wall -Wpointer-arith -Wbad-function-cast -Wno-comment -Wno-sign-compare -Wno-cast-qual -Wmissing-noreturn -Wno-unused-parameter FileHandle.c
cc1plus: warning: command line option '-Wbad-function-cast' is valid for C/ObjC but not for C++
FileHandle.xs:972:60: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
  972 |     const size_t len = my_snprintf(buffer, sizeof(buffer), "%"NVgf, value);
      |                                                            ^
FileHandle.xs:992:60: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
  992 |     const size_t len = my_snprintf(buffer, sizeof(buffer), "%"IVdf, value);
      |                                                            ^
"/usr/home/jkeenan/testing/perl-5.32.1/bin/perl" "/home/jkeenan/testing/perl-5.32.1-gpp/lib/5.33.9/ExtUtils/xsubpp"  -typemap '/home/jkeenan/testing/perl-5.32.1/lib/5.33.9/ExtUtils/typemap' -typemap '/usr/home/jkeenan/gitwork/devel-nytprof/typemap'  NYTProf.xs > NYTProf.xsc
mv NYTProf.xsc NYTProf.c
g++ -c    -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2 -O2 -pipe -fstack-protector -fno-strict-aliasing    -DVERSION=\"6.09_001\"  -DXS_VERSION=\"6.09_001\" -DPIC -fPIC "-I/home/jkeenan/testing/perl-5.32.1/lib/5.33.9/amd64-freebsd-thread-multi/CORE"  -DHAS_CLOCK_GETTIME -DHAS_ZLIB -DUSE_HARD_ASSERT -W -Wall -Wpointer-arith -Wbad-function-cast -Wno-comment -Wno-sign-compare -Wno-cast-qual -Wmissing-noreturn -Wno-unused-parameter NYTProf.c
cc1plus: warning: command line option '-Wbad-function-cast' is valid for C/ObjC but not for C++
NYTProf.xs:1841:58: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 1841 |             sprintf(&filename_buf[strlen(filename_buf)], ".%.0"NVff"", gettimeofday_nv());
      |                                                          ^
NYTProf.xs:1860:17: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 1860 |         logwarn("~ opened %s at %.6"NVff"\n", filename, gettimeofday_nv());
      |                 ^
NYTProf.xs:1890:17: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 1890 |         logwarn("~ closed file at %.6"NVff"\n", timeofday);
      |                 ^
NYTProf.xs:1904:17: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 1904 |         logwarn("~ new pid %d (was %d) forkdepth %"IVdf"\n", getpid(), last_pid, profile_forkdepth);
      |                 ^
NYTProf.xs:2229:17: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 2229 |         logwarn("%2u <-     %s %"NVgf" excl = %"NVgf"t incl - %"NVgf"t (%"NVgf"-%"NVgf"), oh %"NVff"-%"NVff"=%"NVff"t, d%d @%d:%d #%lu %p\n",
      |                 ^
NYTProf.xs:2229:38: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 2229 |         logwarn("%2u <-     %s %"NVgf" excl = %"NVgf"t incl - %"NVgf"t (%"NVgf"-%"NVgf"), oh %"NVff"-%"NVff"=%"NVff"t, d%d @%d:%d #%lu %p\n",
      |                                      ^
NYTProf.xs:2229:53: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 2229 |         logwarn("%2u <-     %s %"NVgf" excl = %"NVgf"t incl - %"NVgf"t (%"NVgf"-%"NVgf"), oh %"NVff"-%"NVff"=%"NVff"t, d%d @%d:%d #%lu %p\n",
      |                                                     ^
NYTProf.xs:2229:69: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 2229 |         logwarn("%2u <-     %s %"NVgf" excl = %"NVgf"t incl - %"NVgf"t (%"NVgf"-%"NVgf"), oh %"NVff"-%"NVff"=%"NVff"t, d%d @%d:%d #%lu %p\n",
      |                                                                     ^
NYTProf.xs:2229:79: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 2229 |         logwarn("%2u <-     %s %"NVgf" excl = %"NVgf"t incl - %"NVgf"t (%"NVgf"-%"NVgf"), oh %"NVff"-%"NVff"=%"NVff"t, d%d @%d:%d #%lu %p\n",
      |                                                                               ^
NYTProf.xs:2229:87: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 2229 |         logwarn("%2u <-     %s %"NVgf" excl = %"NVgf"t incl - %"NVgf"t (%"NVgf"-%"NVgf"), oh %"NVff"-%"NVff"=%"NVff"t, d%d @%d:%d #%lu %p\n",
      |                                                                                       ^
NYTProf.xs:2229:100: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 2229 |         logwarn("%2u <-     %s %"NVgf" excl = %"NVgf"t incl - %"NVgf"t (%"NVgf"-%"NVgf"), oh %"NVff"-%"NVff"=%"NVff"t, d%d @%d:%d #%lu %p\n",
      |                                                                                                    ^
NYTProf.xs:2229:108: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 2229 |         logwarn("%2u <-     %s %"NVgf" excl = %"NVgf"t incl - %"NVgf"t (%"NVgf"-%"NVgf"), oh %"NVff"-%"NVff"=%"NVff"t, d%d @%d:%d #%lu %p\n",
      |                                                                                                            ^
NYTProf.xs:2405:17: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 2405 |         logwarn("NYTProf panic: stack is confused, giving up! (Try running with subs=0) ix=%"IVdf" prev_ix=%"IVdf"\n", (IV)subr_entry_ix, (IV)prev_subr_entry_ix);
      |                 ^
NYTProf.xs:2405:98: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 2405 |         logwarn("NYTProf panic: stack is confused, giving up! (Try running with subs=0) ix=%"IVdf" prev_ix=%"IVdf"\n", (IV)subr_entry_ix, (IV)prev_subr_entry_ix);
      |                                                                                                  ^
NYTProf.xs:2895:17: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 2895 |         logwarn("%2u ->%4s %s::%s from %s::%s @%u:%u (d%d, oh %"NVff"t, sub %"NVff"s) #%lu\n",
      |                 ^
NYTProf.xs:2895:69: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 2895 |         logwarn("%2u ->%4s %s::%s from %s::%s @%u:%u (d%d, oh %"NVff"t, sub %"NVff"s) #%lu\n",
      |                                                                     ^
NYTProf.xs:3031:17: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 3031 |         logwarn("~ disable_profile (previously %s, pid %d, trace %"IVdf")\n",
      |                 ^
NYTProf.xs:3051:17: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 3051 |         logwarn("~ finish_profile (overhead %"NVgf"t, is_profiling %d)\n",
      |                 ^
NYTProf.xs:3679:29: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 3679 |                     logwarn("%s call has negative time: incl %"NVff"s, excl %"NVff"s:\n",
      |                             ^
NYTProf.xs:3679:68: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 3679 |                     logwarn("%s call has negative time: incl %"NVff"s, excl %"NVff"s:\n",
      |                                                                    ^
NYTProf.xs:3690:29: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 3690 |                     logwarn("%s called by %.*s at %u:%u: count %ld (i%"NVff"s e%"NVff"s, d%d ri%"NVff"s)\n",
      |                             ^
NYTProf.xs:3690:76: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 3690 |                     logwarn("%s called by %.*s at %u:%u: count %ld (i%"NVff"s e%"NVff"s, d%d ri%"NVff"s)\n",
      |                                                                            ^
NYTProf.xs:3690:86: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 3690 |                     logwarn("%s called by %.*s at %u:%u: count %ld (i%"NVff"s e%"NVff"s, d%d ri%"NVff"s)\n",
      |                                                                                      ^
NYTProf.xs:4279:17: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 4279 |         logwarn("Sub %s called by %s %u:%u: count %d, incl %"NVff", excl %"NVff"\n",
      |                 ^
NYTProf.xs:4279:66: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 4279 |         logwarn("Sub %s called by %s %u:%u: count %d, incl %"NVff", excl %"NVff"\n",
      |                                                                  ^
NYTProf.xs:4401:17: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 4401 |         logwarn("Start of profile data for pid %s (ppid %d, %"IVdf" pids live) at %"NVff"\n",
      |                 ^
NYTProf.xs:4401:67: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 4401 |         logwarn("Start of profile data for pid %s (ppid %d, %"IVdf" pids live) at %"NVff"\n",
      |                                                                   ^
NYTProf.xs:4433:17: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 4433 |         logwarn("End of profile data for pid %s (%"IVdf" remaining) at %"NVff"\n", text,
      |                 ^
NYTProf.xs:4433:56: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 4433 |         logwarn("End of profile data for pid %s (%"IVdf" remaining) at %"NVff"\n", text,
      |                                                        ^
NYTProf.xs:5004:17: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 5004 |         logwarn("Profile data incomplete, no terminator for %"IVdf" pids %s\n",
      |                 ^
NYTProf.xs:5046:21: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 5046 |             logwarn("The sum of the statement timings is %.1"NVff"%% of the total time profiling."
      |                     ^
NYTProf.xs:5054:21: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 5054 |             logwarn("Summary: statements profiled %lu (=%lu-%lu), sum of time %"NVff"s, profile spanned %"NVff"s\n",
      |                     ^
NYTProf.xs:5054:85: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 5054 |             logwarn("Summary: statements profiled %lu (=%lu-%lu), sum of time %"NVff"s, profile spanned %"NVff"s\n",
      |                                                                                     ^
NYTProf.xs:226:37: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  226 | static Hash_table fidhash = { NULL, "fid", MAX_HASH_SIZE, sizeof(fid_hash_entry), NULL, NULL, NULL, 1 };
      |                                     ^~~~~
NYTProf.xs:231:37: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  231 | static Hash_table strhash = { NULL, "str", MAX_HASH_SIZE, sizeof(str_hash_entry), NULL, NULL, NULL, 1 };
      |                                     ^~~~~
NYTProf.xs:243:44: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  243 | static char *nytp_panic_overflow_msg_fmt = "panic: buffer overflow of %s on '%s' (see TROUBLESHOOTING section of the NYTProf documentation)";
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@jkeenan
Copy link
Collaborator Author

jkeenan commented May 6, 2021

#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

@jkeenan
Copy link
Collaborator Author

jkeenan commented May 6, 2021

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

@jkeenan
Copy link
Collaborator Author

jkeenan commented May 9, 2021

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

@jkeenan
Copy link
Collaborator Author

jkeenan commented Sep 19, 2021

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*'",
  },
]

@jkeenan
Copy link
Collaborator Author

jkeenan commented Oct 4, 2023

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?

jkeenan added a commit to jkeenan/devel-nytprof that referenced this issue Oct 7, 2023
In an attempt to eliminate build-time warnings.  See:
timbunce#191.
jkeenan added a commit to jkeenan/devel-nytprof that referenced this issue Oct 8, 2023
In an attempt to eliminate build-time warnings.  See:
timbunce#191.
jkeenan added a commit to jkeenan/devel-nytprof that referenced this issue Oct 8, 2023
Done to eliminate build-time warnings.  See:
timbunce#191.

Increment $VERSION to 6.12_004 for additional trial release.
jkeenan added a commit to jkeenan/devel-nytprof that referenced this issue Oct 8, 2023
Done to eliminate build-time warnings.  See:
timbunce#191.

When compiled with a perl built with g++, there now remain two
'-Wwrite-strings' warnings which look like this:

    ISO C++ forbids converting a string constant to char*

Increment $VERSION to 6.12_004 for additional trial release.
@jkeenan
Copy link
Collaborator Author

jkeenan commented Oct 10, 2023

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.

jkeenan added a commit that referenced this issue Oct 13, 2023
Done to eliminate build-time warnings.  See:
#191.

When compiled with a perl built with g++, there now remain two
'-Wwrite-strings' warnings which look like this:

    ISO C++ forbids converting a string constant to char*

Increment $VERSION to 6.12_004 for additional trial release.
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Dec 16, 2023
  Changes in Devel::NYTProf 6.14 - 18th Oct 2023
    There should be no significant differences in the performance of
    Devel-NYTProf from that of the previous release. This release is
    primarily maintenance- focused.

    More build-time warnings using recent versions of C compilers have been
    eliminated, particularly with recent production releases of Perl. Thanks
    to Karl Williamson for guidance on updating ppport.h and using it to
    update NYTProf.xs.

  Changes in Devel::NYTProf 6.13 - 10th Oct 2023
    There should be no significant differences in the performance of
    Devel-NYTProf from that of the previous release. This release is
    primarily maintenance- focused.

    The largest difference in the distribution is the removal of the
    nytprofpf program (GH 206
    <timbunce/devel-nytprof#206>). This program was
    written for an open-source software competition which is no longer being
    held.

    Other changes include:

    Removal of remaining reference to Travis CI (GH 202
    <timbunce/devel-nytprof#202>).

    Elimination of 'bad-function-cast' warnings during 'make' (GH 205
    <timbunce/devel-nytprof#205>).

    Correction of typographic error in nytprofhtml thanks to Amory Meltzer
    (GH 210 <timbunce/devel-nytprof#210>).

    Depending on Per version, skip one test file that was exercising 'given'
    and 'when' keywords (now deprecated) (GH 211
    <timbunce/devel-nytprof#211>).

    Elimination of the 'register' keyword from NYTProf.xs (partial
    resolution of GH 191
    <timbunce/devel-nytprof#191>) which is
    forbidden as of ISO C++17.
@bulk88
Copy link
Contributor

bulk88 commented Dec 4, 2024

Just remove the register token. Perl 5 core removed the register keyword very long ago, and NYTProf's use looks like copy pastes from pre-5.6 Perl. Keyword "register" has little purpose nowadays other than syntax forbidding & address of operator.
https://learn.microsoft.com/en-us/cpp/c-language/register-storage-class-specifier?view=msvc-170

No production C compiler will ever listen to the register keyword for optimization vs the CC's own variable liveness analysis code and the CC's bundled optimization algos. Homework/educational C compilers written over a weekend might use it, but its just not applicable nowadays.

Decades ago register keyword was used for integrating "inline assembly" features into C. The keyword was a ISO C spec "portal" to a huge amount of vendor specific CC features. Microsoft removed inline assembly 20 years ago. GCC inline assembly, the psuedo assembly syntax/grammar has the mechanism to capture/transfer integers between C lang and GCC assembly lang, the syntax isn't the C lang side of GCC,

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

No branches or pull requests

2 participants