Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: Baffling compilation errors from Strawberry Perlby no longer just digit (Beadle) |
on Feb 21, 2021 at 00:04 UTC ( [id://11128611]=note: print w/replies, xml ) | Need Help?? |
That seems to work. Aaah ... but it does matter in libdeflate-one.c, where free (and malloc) need to be implemented according to the stdlib.h specification, not according to perl's (re)definition of them. By undef'ing those 2 symbols, we ensure that the stdlib.h implementations are used. Thank you for these insights. I tried any number of things, but the
idea was not one of them. I understand that XSUB.h or another Perl header file redefines malloc into a Perl function or macro which takes two arguments, but the thing which I still find confusing is that the error messages appear to be coming from XSUB.h yet the actual error is occurring within my C file libdeflate-one.c, so the error messages seem to assume that the error occurred on another line from where they actually did. Since the compiler is gcc it's not the fault of Microsoft Windows. EditI have just spent a little time debugging another XS module on Strawberry Perl (for details see this diff) and I'd like to point out that
and probably
are also needed if the C code is using those as well. There is no error message from Windows, and the GDB backtrace looks like this:
I found out what was wrong by Googling and puzzling over this bug report. It took a few attempts before I thought of this realloc problem.
In Section
Seekers of Perl Wisdom
|
|