Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

What is __need___va_list, and do I need it?

by BoredByPolitics (Scribe)
on Jan 12, 2001 at 20:59 UTC ( #51398=perlquestion: print w/replies, xml ) Need Help??

BoredByPolitics has asked for the wisdom of the Perl Monks concerning the following question:

I've been merrily writing a program over the last week, when today while testing it I'm getting the following warning -

Constant subroutine __need___va_list undefined at /usr/lib/perl5/5.005 +03/i386-linux/stdarg.ph line 9.

My code still appears to run ok, and looking in the Camel book I find that this error means I've undefined a subroutine which had been eligble for inlining..... eh?

Could somebody please explain what the error, and explanation, actually mean!

Cheers :0)

Pete

Replies are listed 'Best First'.
(tye)Re: What is __need___va_list, and do I need it?
by tye (Sage) on Jan 13, 2001 at 11:30 UTC

    h2ph is passe and it became passe because it had problems. I suspect that your /usr/include/stdarg.h contains:

    #define __need__va_list 1 /*or something*/ ... #undef __need__va_list
    and h2ph just translates it into some Perl approximation of the same thing and does it in a way that isn't clean when warnings are enabled (perhaps that warning was added after h2ph stopped being actively maintained).

    It would probably be pretty easy for you as a human (and thus being much smarter than the h2ph script) to clean up stdarg.ph to make it not emit any warnings. Avoiding new uses of h2ph and *.ph files would also be a good idea, BTW (though I'm not implying any judgement on what you are currently doing).

            - tye (but my friends call me "Tye")
      It would probably be pretty easy for you as a human (and thus being much smarter than the h2ph script) to clean up stdarg.ph to make it not emit any warnings. Avoiding new uses of h2ph and *.ph files would also be a good idea, BTW (though I'm not implying any judgement on what you are currently doing).

      I've done a little more investigating and have found that the warning is being generated by my use of this line -
      use Sys::Syslog qw(:DEFAULT setlogsock);

      The relevant line in the stdarg.ph file is -
       undef(&__need___va_list) if defined(&__need___va_list);

      And in /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h there are the two lines that you suggested would be there.

      a's post is interesting too, seeing as the eventual target platform for the program is Solaris... I'll get in touch with the client on Monday and find out if they get the same problem, or whether they've resolved it in the way you suggest (tidying up the stdarg.ph).

      Thanks very much for the responses :0)

      Pete

Re: What is __need___va_list, and do I need it?
by a (Friar) on Jan 13, 2001 at 11:20 UTC
    Not really a clue but va_list is a variable argument list and on Solaris its a sore point w/ various added softwares. The va list thing isn't always well supported. I see a couple answers (google on "__need__va_list") suggesting not enough h2ph-ing e.g.:
    "You need to run h2ph on your .h files. On a linux box, do this in /usr/include ..."
    did you remember to h2ph the private gcc includes (generally in /usr/lib/gcc/.../include)

    So, arch./OS related you may find this helps.

    a

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://51398]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2022-05-17 13:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (65 votes). Check out past polls.

    Notices?