[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[UDUNITS #OBJ-198091]: udunits 2.2.26 fails to build against clang 12.0.0



Rick,

I did the same to "formatter.c" as I did to "converter.c". Try the latest:

    wget ftp://ftp.unidata.ucar.edu/pub/udunits/beta/udunits-2.2.27.18.tar.gz

> Very frustrating problem all around; confusing, too.
> 
> % pwd
> /Users/grubin/test/udunits-2.2.27.17
> % grep XOPEN lib/converter.c
> %
> 
> so _XOPEN_SOURCE isn't defined in lib/converter.c directly after unpacking
> the gzip'd tar file.
> 
> After running configure, it remains undefined in that file.
> 
> % ./configure CFLAGS="-std=c99" > configure.log 2>&1
> % make V=Y > make.log 2>&1
> 
> Logs are attached. Anything else you'd like to see?
> 
> Perhaps this is helpful -- after running configure, appears that
> lib/formatter.c isn't updated as expected.
> 
> % grep XOPEN *
> CHANGE_LOG:    converter.c: Replaced default definition of _XOPEN_SOURCE
> with #include of
> CHANGE_LOG:        * configure(1): Added _XOPEN_SOURCE definition
> grep: build-aux: Is a directory
> config.h:#define _XOPEN_SOURCE 600
> config.h.in:#undef _XOPEN_SOURCE
> config.log:| #define _XOPEN_SOURCE 600
> config.log:| #define _XOPEN_SOURCE 600
> config.log:| #define _XOPEN_SOURCE 600
> config.log:| #define _XOPEN_SOURCE 600
> config.log:#define _XOPEN_SOURCE 600
> config.status:D["_XOPEN_SOURCE"]=" 600"
> configure:# NB: Solaris 10 doesn't support _XOPEN_SOURCE beyond 600
> configure:$as_echo "#define _XOPEN_SOURCE 600" >>confdefs.h
> configure.ac:# NB: Solaris 10 doesn't support _XOPEN_SOURCE beyond 600
> configure.ac:AC_DEFINE([_XOPEN_SOURCE], [600], [Level of X/OPEN compliance])
> grep: lib: Is a directory
> grep: m4: Is a directory
> grep: prog: Is a directory
> 
> % grep XOPEN lib/*.[ch]
> lib/error.c:#ifndef _XOPEN_SOURCE
> lib/error.c:#   define _XOPEN_SOURCE 500
> lib/formatter.c:#ifndef _XOPEN_SOURCE
> lib/formatter.c:#   define _XOPEN_SOURCE 500
> lib/idToUnitMap.c:#ifndef _XOPEN_SOURCE
> lib/idToUnitMap.c:#   define _XOPEN_SOURCE 500
> lib/parser.c:#ifndef _XOPEN_SOURCE
> lib/parser.c:#   define _XOPEN_SOURCE 500
> lib/prefix.c:#ifndef _XOPEN_SOURCE
> lib/prefix.c:#   define _XOPEN_SOURCE 500
> lib/status.c:#ifndef _XOPEN_SOURCE
> lib/status.c:#   define _XOPEN_SOURCE 500
> lib/systemMap.c:#ifndef _XOPEN_SOURCE
> lib/systemMap.c:#   define _XOPEN_SOURCE 500
> lib/testUnits-1.c:#ifndef _XOPEN_SOURCE
> lib/testUnits-1.c:#   define _XOPEN_SOURCE 500
> lib/testUnits.c:#ifndef _XOPEN_SOURCE
> lib/testUnits.c:#   define _XOPEN_SOURCE 500
> lib/unitAndId.c:#ifndef _XOPEN_SOURCE
> lib/unitAndId.c:#   define _XOPEN_SOURCE 500
> lib/unitToIdMap.c:#ifndef _XOPEN_SOURCE
> lib/unitToIdMap.c:#   define _XOPEN_SOURCE 500
> lib/unitcore.c:#ifndef _XOPEN_SOURCE
> lib/unitcore.c:#   define _XOPEN_SOURCE 500
> lib/ut_free_system.c:#ifndef _XOPEN_SOURCE
> lib/ut_free_system.c:#   define _XOPEN_SOURCE 500
> lib/xml.c:#ifndef _XOPEN_SOURCE
> lib/xml.c:#   define _XOPEN_SOURCE 500
> lib/xml.c:#ifndef _XOPEN_PATH_MAX
> lib/xml.c:#   define _XOPEN_PATH_MAX 1024 // Includes terminating NUL
> lib/xml.c:    char        buf[_XOPEN_PATH_MAX];
> lib/xml.c:        char base[_XOPEN_PATH_MAX];
> 
> in libs/*.[cy], I changed '500' to '600' and the make succeeded.
> 
> 
> ----
> 
> 
> A quick test to see that I'm looking in the right place for standard header
> files:
> 
> % cat test.c
> # include <stdlib.h>
> # include <stdio.h>
> 
> int main()
> {
> char buf[32];
> int size = 31;
> char *s = "hello, world";
> 
> int n = snprintf(buf, size, "%s", s);
> (void) printf("%s (%d)\n", buf, n);
> }
> 
> % clang -H test.c
> 
> output shows standard header files are located in:
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include

Regards,
Steve Emmerson

Ticket Details
===================
Ticket ID: OBJ-198091
Department: Support UDUNITS
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.