Did you read 'em

/*  DO NOT EDIT THIS FILE.
    It has been auto-edited by fixincludes from:
        "/usr/include/malloc.h"
    This had to be done to correct non-standard usages in the
    original, manufacturer supplied header file.  */

But, ultimately they're pretty much the same except for some type name
changes (__size_t -> _hpux_size_t).

That doesn't get to the root of the problem...

Below is a little test program. IT CAN NOT BE USED AS IS - you need to go
through and delete lines to match up with what's in you config.h file.  When
you're done, it should have the same (effective) includes as ntop.h and
should exhibit the same problem.

-------------------------------------------------------
#ifdef __GNUC__
#define _UNUSED_ __attribute__((unused))
#else
#define _UNUSED_
#define __attribute__(a)
#endif

#if !defined(_REENTRANT)
#define _REENTRANT
#endif
#define _THREAD_SAFE


#include <stdio.h>
#include <errno.h>
#include <stdlib.h>

#include <unistd.h>

#include <string.h>
#include <time.h>
#include <signal.h>
#include <fcntl.h>
#include <ctype.h>

#include <strings.h>

#include <limits.h>
#include <float.h>
#include <math.h>
#include <sys/types.h>

#include <sys/time.h>

#include <sys/wait.h>

#include <sys/stat.h>

#include <sys/ioctl.h>

#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>      /* AIX has it */
#endif

#ifdef HAVE_SYS_LDR_H
#include <sys/ldr.h>         /* AIX has it */
#endif

#ifdef HAVE_SYS_SOCKIO_H
#include <sys/sockio.h>
#endif

#ifdef HAVE_DL_H
#include <dl.h>              /* HPUX has it */
#endif

#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif

#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif

#ifdef HAVE_STANDARDS_H
#include <standards.h>
#endif

#include <sched.h>

#ifdef HAVE_SYS_SCHED_H
 #include <sys/sched.h>
#endif

#if defined(HAVE_SEMAPHORE_H) && !defined(DARWIN)
 #include <semaphore.h>
#endif

#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
 #ifndef _THREAD_SAFE
  #define _THREAD_SAFE
 #endif
#endif

#ifdef HAVE_IF_H
 #include "if.h"              /* OSF1 has it */
#endif

 #include <sys/socket.h>

#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif

#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if.h>

#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <netinet/udp.h>
#include <netinet/tcp.h>

#ifdef HAVE_NETINET_IF_ETHER_H
#include <netinet/if_ether.h>
#endif

#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif

#ifdef HAVE_NET_ETHERNET_H
#include <net/ethernet.h>
#endif

#ifdef HAVE_ETHERTYPE_H
#include <ethertype.h>
#endif

#ifdef HAVE_NET_BPF_H
#include <net/bpf.h>
#endif

#  if defined(HAVE_SYS_SCHED_H)
#   include <sys/sched.h>
#  endif

#  if defined(HAVE_SCHED_H)
#   include <sched.h>
#  endif

#  include <pthread.h>

#  if defined(HAVE_SEMAPHORE_H)
#   include <semaphore.h>
#  else
#   undef MAKE_WITH_SEMAPHORES
#  endif

#include "pcap.h"

#include "regex.h"

/* Compressed HTTP responses via zlib */
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#else
#undef HAVE_ZLIB
#undef MAKE_WITH_ZLIB
#endif

#ifdef HAVE_GDBM_H
#include <gdbm.h>
#endif

#ifdef HAVE_TCPD_H
#include <tcpd.h>
#endif

#ifdef HAVE_SYS_SYSLOG_H
#include <sys/syslog.h>
#else
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif
#endif

#ifdef HAVE_GETOPT_H
#include "getopt.h"
#endif

 #include <malloc.h>

int main(int argc, char *argv[]) {
  printf("Test program running...\n");
  return(0);
}
-------------------------------------------------------

No, I can't work around it, I still don't know what's wrong. YOU need to
contact the hpux gcc porter.  If you can cut down the size of the test
program to the essentials, then you've got a chance at getting a resolution.

You could also grep in /usr/include (or wherever they are), looking for what
#define s _NAMESPACE_STD


-----Burton



-----Original Message-----
From: Falk Hayn [mailto:[EMAIL PROTECTED]
Sent: Monday, March 03, 2003 7:13 AM
To: Burton M. Strauss III
Cc: [EMAIL PROTECTED]
Subject: malloc.h interferes


Burton,

yes, You were right, there are 2 different malloc.h�s which
interfere. I put the original path of each file on top of the file,
so You can see were they reside on my machine.
Pls. find attached 2 malloc.h files.

Can You workaround the problems with some defines ?



> I would hazard a guess that some other include is #define ing
> _NAMESPACE_STD.  Based on this,
>
> #ifdef _NAMESPACE_STD
> #define _NAMESPACE_STD_START namespace std {
> #define _NAMESPACE_STD_END }
> #define _hpux_size_t std::size_t
> #define __time_t std::time_t
> #define __FILE std::FILE
> #define __wint_t std::wint_t
> #define __struct_tm std::tm
> #define __va__list std::va_list
> #else
> #define _NAMESPACE_STD_START
> #define _NAMESPACE_STD_END
> #define _hpux_size_t size_t
> #define __time_t time_t
> #define __FILE FILE
> #define __wint_t wint_t
> #define __struct_tm struct tm
> #define __va__list va_list
> #endif
>
> and the code at line 80
>
> _NAMESPACE_STD_START
>    void free(void *);
> _NAMESPACE_STD_END
>
> That would cause a C++ style definition:
>
> namespace std {
>    void free(void *);
> }
>
> which is probably what the compile is complaining about.
>
> You can test it by manually running only the c pre-processor using the -E
> flag on webInterface.c, e.g. gcc ...whatever... -E webInterface.cppout
>
> It's some kind of HP-UX specific conflict with the various includes.
> You'll
> have to figure out where (and to what) _NAMESPACE_STD_START is getting
> set.
>
>
> -----Burton
>
>
>
>
> -----Original Message-----
> From: Falk Hayn [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 28, 2003 11:11 AM
> To: Burton M. Strauss III
> Subject: ntop-03-02-24: malloctest.c worked, no bogus messages
>
>
> Burton,
>
> I tried ou Your test. It worked. No bogus messages.
>
> ../src $gcc -o malloctest malloctest.c
>
> (no bogus messages)
>
> ../src $cat  malloctest.c
>
> #include <malloc.h>
>
> int main(int argc, char *argv[]) {
>     struct mallinfo memStats;
>     memStats = mallinfo();
> }
>
>
>
> > Look, basically I DON'T CARE - it's a gcc/HPUX problem.
> >
> > malloc.h is a gcc extension to provide (m|c|re)alloc() usage
> information.
> > My guess is that the HPUX port of malloc.h isn't compatible with other
> > ports.  It's usage in ntop is minor, just to provide a clue as to memory
> > usage, if we can.
> >
> >
> > Make a 6 line test program:
> >
> > ----------------------------------------------
> > #include <malloc.h>
> >
> > int main(int argc, char *argv[]) {
> >     struct mallinfo memStats;
> >     memStats = mallinfo();
> > }
> > ----------------------------------------------
> >
> > and compile it with
> >
> > $ gcc -o malloctest malloctest.c
> >
> > If the test gives the same error, I'll #ifdef it out, but that's the
> > limit.
> > It's a gnu gcc issue, NOT ntop!
> >
> >
> > -----Burton
> >
> >
> >
> > -----Original Message-----
> > From: Falk Hayn [mailto:[EMAIL PROTECTED]
> > Sent: Friday, February 28, 2003 10:17 AM
> > To: [EMAIL PROTECTED]
> > Cc: [EMAIL PROTECTED]
> > Subject: ntop-03-02-24: webinterface.c is reproducable
> >
> >
> > Stefan, Burton,
> >
> > the issue with webinterface.c is reproducable
> > in my enviroment with gcc 3.0.4.
> >
> > 3.0.4 is quite safe and builded lots of packages
> > (ethereal and all deps / tcl, tk, expect )
> >
> > Pls see attached make.results.gz file.
> > Pls see attached malloc.h file which was bundled with
> > the gcc compiler.
> >
> >
> > These are the other results:
> >
> > +++++++++++++++++++++++++++++++++++++
> > openssl
> > configure stage completed
> > make  stage completed
> > make test  stage completed
> > make install  stage completed
> > --> when using the config options Burton proposed
> > +++++++++++++++++++++++++++++++++++++
> > in gdchart0.94c directory
> > ./buildAll.sh > buildAll.results 2>&1
> >
> > Stage completed,
> > no errors or warnings  in  buildAll.results
> > +++++++++++++++++++++++++++++++++++++
> > in ntop directory
> > ./configure  > configure.results 2>&1
> >
> > no errors or warnings  in  configure.results
> > +++++++++++++++++++++++++++++++++++++
> > in ntop directory
> > make  > make.results 2>&1
> >
> > build stopped with webinterface.c messages
> > Pls see attached make.results.gz file.
> > +++++++++++++++++++++++++++++++++++++
>
>
>

--
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
Bitte l�cheln! Fotogalerie online mit GMX ohne eigene Homepage!

_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev

Reply via email to