[mrtg] "long long" compile solution HP-UX 11.00

Briggs, Patrick pbriggs at clinitech.net
Fri Sep 12 18:36:55 MEST 2003


After doing some research, I found that HP-UX does have a system call for
strtoll, but it is hidden with two underscore characters.  Who knows why
HP-UX insists on doing non-standard odd things like this.  So what I've done
is go into the configure script for mrtg:
Added a line:
#include <inttypes.h>

Changed the line:
i=strtoll(val,NULL,10);
to:
i=__strtoll(val,NULL,10);

Once this was done, it is compiling ok and seems to be running good as well.

I'd recommend a patch be done to configure script to take in account HP-UX
oddity with strtoll.  This will help other HP-UX users to compile clean
without being stopped dead in their tracks.
Here is the code section as I modified it:

#include <stdlib.h>
#include <strings.h>
#include <inttypes.h>
#define val "9223372036854775807"

int main(void){
   char x[100];
   long long i;
   i=__strtoll(val,NULL,10);
   if (sprintf(x,"%lld",i) < 0) {
         printf ("sprintf error\n");
                return 1;
   }
   if (strcmp(x,val) != 0) {
         printf ("error '%s' != '%s'\n", x,val);
                return 1;
   }
   return 0;
}

-----Original Message-----
From: Briggs, Patrick [mailto:pbriggs at clinitech.net]
Sent: Thursday, September 11, 2003 12:16 PM
To: 'mrtg at list.ee.ethz.ch'
Subject: [mrtg] "long long" compile problem HP-UX 11.00


I'm unable to compile mrtg-2.10.4 on HP-UX 11.00 using GCC-3.3.1.  I scanned
this mailing list and see others who have the same error message, but nobody
posted a solution.  configure gives me this error:
checking if long long works here... nope
checking if quad works here... nope

** Ooops, your compiler seems to have issues with long long:

   figure out how to get long long, printf with %lld or %qd and
   strtoll working on your platform.
   probably the  config.log file can give you a hint.

So what is the solution?  I have tried "-D_INCLUDE_LONGLONG" and even tried
CC compile with +DD64 to no avail.

Patrick Briggs
Unix System Administrator
Clinitech Information Resources, Inc.

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi
This e-mail message, including any attachments, is for the sole use of the
intended recipient(s) and may contain confidential or privileged
information.  Any unauthorized review, use, disclosure or distribution is
prohibited.  If you are not the intended recipient, please contact the
sender by reply e-mail and destroy the message.


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list