timbunce / devel-nytprof

Devel::NYTProf is a powerful feature-rich source code profiler for Perl. (Mostly in maintenance mode, so PRs are much more likely to be acted upon than Issues.)
http://blog.timbunce.org/tag/nytprof/
67 stars 51 forks source link

Fix one build-time warning observed on appveyor builds #165

Closed jkeenan closed 3 years ago

jkeenan commented 3 years ago

E.g.: https://ci.appveyor.com/project/jkeenan/devel-nytprof/builds/38849328

jkeenan commented 3 years ago

There is one build-time warning being generated during Appveyor CI runs on Windows. See, for example, this recent build on master. The warning looks like this:

gcc -c   -DWIN32 -DWIN64 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -s -O2   -DVERSION=\"6.07\" -DXS_VERSION=\"6.07\"  "-IC:\STRAWB~1\perl\lib\CORE"  -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
NYTProf.xs: In function '_init_profiler_clock':
NYTProf.xs:3145:19: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'DWORD' {aka 'long unsigned int'} [-Wformat=]
             croak("%s failed with Win32 error %u, no clocks available", fnname, GetLastError());
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~          ~~~~~~~~~~~~~~
At top level:
NYTProf.xs:1220:1: warning: 'get_str_id' defined but not used [-Wunused-function]
 get_str_id(pTHX_ char* str, STRLEN len)
 ^~~~~~~~~~
"C:\strawberry\perl\bin\perl.exe" -MExtUtils::Mksymlists \
     -e "Mksymlists('NAME'=>\"Devel::NYTProf\", 'DLBASE' => 'NYTProf', 'DL_FUNCS' => {  }, 'FUNCLIST' => [q[boot_Devel__NYTProf], q[boot_Devel__NYTProf__FileHandle]], 'IMPORTS' => {  }, 'DL_VARS' => []);"
g++ NYTProf.def -o blib\arch\auto\Devel\NYTProf\NYTProf.xs.dll -mdll -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib" FileHandle.o NYTProf.o   "C:\STRAWB~1\perl\lib\CORE\libperl532.a" -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 -Wl,--enable-auto-image-base
"C:\strawberry\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 755 blib\arch\auto\Devel\NYTProf\NYTProf.xs.dll

(We're concerned with the warning at line 3145; the warning at line 1220 is a separate issue to be addressed soon.)

This can be fixed by the patch in this pull request. See this build for the correction.

jkeenan commented 3 years ago

Pushed to master in merge commit e1a68ac. Closing p.r.