[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,

Alright. That does it. I thought I might be able to get away fixing this 
problem piecemeal but that didn't work. I've modified all the files to 
(hopefully) eliminate this problem once and for all.

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

> % echo $CC $CFLAGS
> clang -fPIC
> % echo $FC $FCFLAGS
> gfortran -fPIC
> 
> % ./configure CFLAGS="-std=c99" > configure.log 2>&1
> %  make V=Y > make.log 2>&1
> [...]
> libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -DNDEBUG -std=c99 -MT
> unitAndId.lo -MD -MP -MF .deps/unitAndId.Tpo -c unitAndId.c  -fno-common
> -DPIC -o .libs/unitAndId.o
> unitAndId.c:59:18: error: implicit declaration of function 'strdup' is
> invalid in C99 [-Werror,-Wimplicit-function-declaration]
> entry->id = strdup(id);
> ^
> unitAndId.c:59:18: note: did you mean 'strcmp'?
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h:77:6:
> note: 'strcmp' declared here
> int      strcmp(const char *__s1, const char *__s2);
> ^
> unitAndId.c:59:16: warning: incompatible integer to pointer conversion
> assigning to 'char *' from 'int' [-Wint-conversion]
> entry->id = strdup(id);
> ^ ~~~~~~~~~~
> 1 warning and 1 error generated.
> make[4]: *** [unitAndId.lo] Error 1
> make[3]: *** [all-recursive] Error 1
> make[2]: *** [all] Error 2
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
> 
> Logs attached.
> 
> --
> Rick Grubin
> Joint Center for Satellite Data Assimilation
> UCAR Foothills Lab / Building 4
> 3300 Mitchell Lane
> Boulder, CO 80301
> address@hidden


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.