Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Matts (1087)

  (email not shown publicly)

I work for MessageLabs [] in Toronto, ON, Canada. I write spam filters, MTA software, high performance network software, string matching algorithms, and other cool stuff mostly in Perl and C.

Journal of Matts (1087)

Monday January 04, 2010
05:13 PM

Warning compiling perl stuff on Snow Leopard

[ #40075 ]

I've searched but can't find any reference to this...

Compiling IO::KQueue on Snow Leopard I get the following warning:

KQueue.xs: In function 'XS_IO__KQueue_kevent':
KQueue.xs:71: warning: format not a string literal and no format arguments

Yet that line is just:

    Newxz(ke, max_events, struct kevent);

Which seems to me pretty standard perl, and no format strings involved (though Newxz expands quite a few macros).

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Clang gives a few more details:

    KQueue.xs:71:5: warning: format string is not a string literal (potentially insecure)
        Newxz(ke, max_events, struct kevent);
    /System/Library/Perl/5.10.0/darwin-thread- multi-2level/CORE/handy.h:776:28: note: instantiated from:
    #define Newxz(v,n,t)    (v = (MEM_WRAP_CHECK_(n,t) MEM_LOG_ALLOC(n,t,(t*)safecalloc((n),sizeof(t)))))

    • Never mind... It's just a buggette in the perl that ships with SL...

      MEM_WRAP_CHECK_1 is defined as:

      #define MEM_WRAP_CHECK_1(n,t,a) \
          (void)(sizeof(t) > 1 && ((MEM_SIZE)(n)+0.0) > MEM_SIZE_MAX/sizeof(t) && (Perl_croak_nocontext(a),0))

      Fix is to change it to:

      #define MEM_WRAP_CHECK_1(n,t,a) \
          (void)(sizeof(t) > 1 && ((MEM_SIZE)(n)+0.0) > MEM_SIZE_MAX/sizeof(t) && (Perl_croak_nocontext("%s",(a)),0))