cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [autobuild] those FreeBSD warnings

From: Joe Halpin <j.p.h_at_comcast.net>
Date: Mon, 01 Mar 2004 18:11:49 -0600

Daniel Stenberg wrote:
> Hi (Joe)
>
> I'm looking at your FreeBSD build:
>
> http://curl.haxx.se/auto/log.cgi?id=20040301010441-1578
>
> All those warnings are the same ones, which gcc finds in a system header. Can
> you check if these warnings are caused by the -Wundef option?

My first inclination is to fix the source rather than turning off
compiler warnings, and since the attached patch seems to do the trick on
my Solaris 9, FreeBSD and Linux boxes I'll submit these and see what you
think.

> I'd like to switch off whatever option it is that is causing your gcc version
> to report these warnings in the system headers.
>
> (and *thanks* for setting up and running this for us!)

You're welcome. Curl is doing good things for my company, so I'm happy
to return the favor.

Joe

Index: lib/setup.h
===================================================================
RCS file: /repository/curl/lib/setup.h,v
retrieving revision 1.48
diff -u -r1.48 setup.h
--- lib/setup.h 1 Mar 2004 16:23:35 -0000 1.48
+++ lib/setup.h 2 Mar 2004 00:07:22 -0000
@@ -32,6 +32,10 @@
 #define CURL_DISABLE_GOPHER
 #endif
 
+#if defined(__FreeBSD)
+#define _POSIX_C_SOURCE 1
+#endif
+
 #if !defined(WIN32) && defined(__WIN32__)
 /* This should be a good Borland fix. Alexander J. Oss told us! */
 #define WIN32
Index: include/curl/curl.h
===================================================================
RCS file: /repository/curl/include/curl/curl.h,v
retrieving revision 1.241
diff -u -r1.241 curl.h
--- include/curl/curl.h 1 Mar 2004 16:20:20 -0000 1.241
+++ include/curl/curl.h 2 Mar 2004 00:07:23 -0000
@@ -98,10 +98,14 @@
    || defined(_LARGEFILE_SOURCE) || defined(_LARGEFILE64_SOURCE)
   /* For now, we assume at least one of these to be set for large files to
      work! */
-#define CURL_FORMAT_OFF_T "%lld"
+# ifndef CURL_FORMAT_OFF_T
+# define CURL_FORMAT_OFF_T "%lld"
+# endif
 #else /* LARGE_FILE support */
+#if !defined(CURL_FORMAT_OFF_T)
 #define CURL_FORMAT_OFF_T "%ld"
 #endif
+#endif
 #endif /* GCC or Watcom on Windows */
 #endif /* MSC_VER */
 
Received on 2004-03-02