Hi David,

Welcome back, and glad to hear the Prima modules are getting some attention!

I recently added “use strict; use warnings” to everything in the PDL distro, 
and have squashed (or in some cases actually fixed) most of the warnings 
resulting. Evidently this is one I missed. I have just added a commit to not 
use the PMFunc if it is set to undef.

For clarity: PMCode is pure-Perl wrapper code (which also makes the XS not have 
varargs handling, which always struck me as pointless); PMFunc overrides the 
default of making the “PDL::whatever” also be in the current package and 
therefore exportable, so setting it to undef or empty-string would prevent that 
behaviour.

Once you’re happy with updated Prima modules, please let us know so we can make 
sure the PDL::Graphics::Simple driver for it also is up to date (or of course 
you can check that yourself and PR the results!).

Best regards,
Ed

From: David Mertens<mailto:dcmertens.p...@gmail.com>
Sent: 09 February 2022 04:47
To: pdl-devel@lists.sourceforge.net<mailto:pdl-devel@lists.sourceforge.net>
Subject: [Pdl-devel] Issue when setting PMFunc to undef

Hello everyone,

After years, I am finally dusting off PDL::Graphics::Prima. I'm compiling 
PDL::Drawing::Prima and getting a lot of warnings of this sort:

Use of uninitialized value $obj{"PMFunc"} in concatenation (.) or string at 
/home/dcmertens/perl5/lib/perl5/x86_64-linux-thread-multi/PDL/PP.pm line 1060.

Interestingly, in my pp_def calls, I consistently set PMFunc => undef and 
PMCode to something interesting. My memory is too hazy for me to remember the 
distinction between these two, but presumably I had a reason for doing this 
back in 2011. Note: everything compiles and works fine.

Is this a bug in how pp_def handles PMFunc, or is there something in my code 
that I should change to suppress these warnings?

Thanks!
David

--
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan

_______________________________________________
pdl-devel mailing list
pdl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-devel

Reply via email to