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

Compiler warnings during build #8

Closed
PhilterPaper opened this issue Feb 13, 2021 · 3 comments
Closed

Compiler warnings during build #8

PhilterPaper opened this issue Feb 13, 2021 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@PhilterPaper
Copy link
Owner

Long-time compile warnings that should be dealt with some day:

gcc -c -I"." -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -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=\"1.06\"" "-DXS_VERSION=\"1.06\"" -I"C:\STRAWB~1\perl\lib\CORE" -I"C:\STRAWB~1\c\include" -o "lib\Text\KnuthPlass.o" "lib\Text\KnuthPlass.c"
In file included from C:\STRAWB~1\perl\lib\CORE/perl.h:5644:0,
                 from lib\\Text\\KnuthPlass.xs:2:
lib\\Text\\KnuthPlass.xs: In function 'XS_Text__KnuthPlass__init_nodelist':
C:\STRAWB~1\perl\lib\CORE/hv.h:480:10: warning: passing argument 6 of 'Perl_hv_common_key_len' makes pointer from integer without a cast [-Wint-conversion]
          (val), (hash)))
          ^
C:\STRAWB~1\perl\lib\CORE/embed.h:228:77: note: in definition of macro 'hv_common_key_len'
 #define hv_common_key_len(a,b,c,d,e,f) Perl_hv_common_key_len(aTHX_ a,b,c,d,e,f)
                                                                             ^
C:\STRAWB~1\perl\lib\CORE/hv.h:512:5: note: in expansion of macro 'hv_store'
     hv_store((hv), ("" key ""), (sizeof(key)-1), (val), 0)
     ^~~~~~~~
lib\\Text\\KnuthPlass.xs:153:5: note: in expansion of macro 'hv_stores'
     hv_stores((HV*)self, "activeNodes", ((IV)activelist));
     ^
In file included from C:\STRAWB~1\perl\lib\CORE/perl.h:5609:0,
                 from lib\\Text\\KnuthPlass.xs:2:
C:\STRAWB~1\perl\lib\CORE/proto.h:1172:21: note: expected 'SV * {aka struct sv *}' but argument is of type 'long long int'
 PERL_CALLCONV void* Perl_hv_common_key_len(pTHX_ HV *hv, const char *key, I32 klen_i32, const int action, SV *val, const U32 hash);
                     ^~~~~~~~~~~~~~~~~~~~~~
ExtUtils::Mkbootstrap::Mkbootstrap('blib\arch\auto\Text\KnuthPlass\KnuthPlass.bs')
Generating script 'lib\Text\KnuthPlass.lds'
dlltool --def "lib\Text\KnuthPlass.def" --output-exp "lib\Text\KnuthPlass.exp"
g++ -o "blib\arch\auto\Text\KnuthPlass\KnuthPlass.xs.dll" -Wl,--base-file,"lib\Text\KnuthPlass.base" -Wl,--enable-auto-image-base -mdll -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib" "lib\Text\KnuthPlass.lds" "lib\Text\KnuthPlass.exp"
dlltool --def "lib\Text\KnuthPlass.def" --output-exp "lib\Text\KnuthPlass.exp" --base-file "lib\Text\KnuthPlass.base"
g++ -o "blib\arch\auto\Text\KnuthPlass\KnuthPlass.xs.dll" -Wl,--enable-auto-image-base -mdll -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib" "lib\Text\KnuthPlass.lds" "lib\Text\KnuthPlass.exp"

I'm not sure if there are two, or just one, separate errors here. This is the "cpan" build from Strawberry Perl (Windows) 5.26.1. It builds and runs, but it would just be nice to have a clean build.

@PhilterPaper PhilterPaper added bug Something isn't working help wanted Extra attention is needed labels Feb 13, 2021
@PhilterPaper PhilterPaper changed the title Compiler warnngs during build Compiler warnings during build Feb 13, 2021
@PhilterPaper
Copy link
Owner Author

Does anyone else get different warnings and/or errors on other Perl versions, or non-Strawberry installations?

@PhilterPaper
Copy link
Owner Author

Looking over the error messages again, I'm wondering if this might even be a shortcoming in Strawberry's implementation of the C/C++ libraries, rather than something in the Text-KnuthPlass code? Another deep dive into the code is needed...

@PhilterPaper
Copy link
Owner Author

With help from @sisyphus in StrawberryPerl/Perl-Dist-Strawberry#34, I was able to change

     hv_stores((HV*)self, "activeNodes", ((IV)activelist));

to

     hv_stores((HV*)self, "activeNodes", ((SV *)activelist));

and now it compiles cleanly without warnings (t-tests and examples work, too).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant