Opened 3 years ago

Closed 3 years ago

#62344 closed defect (fixed)

sgrep2 @1.94a: error: implicitly declaring library function 'strcmp'

Reported by: cooljeanius (Eric Gallager) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: bigsur catalina Cc:
Port: sgrep2

Description

Another victim of -Werror=implicit-function-declaration being on by default now:

DEBUG: system:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_sgrep2/sgrep2/work/sgrep-1.94a" && /usr/bin/make -j16 -w all 
make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_sgrep2/sgrep2/work/sgrep-1.94a'
/Library/Developer/CommandLineTools/usr/bin/make  all-am
make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_sgrep2/sgrep2/work/sgrep-1.94a'
source='main.c' object='main.o' libtool=no \
	depfile='.deps/main.Po' tmpdepfile='.deps/main.TPo' \
	depmode=gcc3 /bin/sh ./depcomp \
	/usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I. -DDATADIR="\"/opt/local/share\""  -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk  -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64 -c `test -f 'main.c' || echo './'`main.c
source='preproc.c' object='preproc.o' libtool=no \
	depfile='.deps/preproc.Po' tmpdepfile='.deps/preproc.TPo' \
	depmode=gcc3 /bin/sh ./depcomp \
	/usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I. -DDATADIR="\"/opt/local/share\""  -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk  -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64 -c `test -f 'preproc.c' || echo './'`preproc.c
source='common.c' object='common.o' libtool=no \
	depfile='.deps/common.Po' tmpdepfile='.deps/common.TPo' \
	depmode=gcc3 /bin/sh ./depcomp \
	/usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I. -DDATADIR="\"/opt/local/share\""  -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk  -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64 -c `test -f 'common.c' || echo './'`common.c
source='parser.c' object='parser.o' libtool=no \
	depfile='.deps/parser.Po' tmpdepfile='.deps/parser.TPo' \
	depmode=gcc3 /bin/sh ./depcomp \
	/usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I. -DDATADIR="\"/opt/local/share\""  -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk  -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64 -c `test -f 'parser.c' || echo './'`parser.c
source='optimize.c' object='optimize.o' libtool=no \
	depfile='.deps/optimize.Po' tmpdepfile='.deps/optimize.TPo' \
	depmode=gcc3 /bin/sh ./depcomp \
	/usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I. -DDATADIR="\"/opt/local/share\""  -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk  -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64 -c `test -f 'optimize.c' || echo './'`optimize.c
source='pmatch.c' object='pmatch.o' libtool=no \
	depfile='.deps/pmatch.Po' tmpdepfile='.deps/pmatch.TPo' \
	depmode=gcc3 /bin/sh ./depcomp \
	/usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I. -DDATADIR="\"/opt/local/share\""  -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk  -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64 -c `test -f 'pmatch.c' || echo './'`pmatch.c
source='sgml.c' object='sgml.o' libtool=no \
	depfile='.deps/sgml.Po' tmpdepfile='.deps/sgml.TPo' \
	depmode=gcc3 /bin/sh ./depcomp \
	/usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I. -DDATADIR="\"/opt/local/share\""  -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk  -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64 -c `test -f 'sgml.c' || echo './'`sgml.c
source='eval.c' object='eval.o' libtool=no \
	depfile='.deps/eval.Po' tmpdepfile='.deps/eval.TPo' \
	depmode=gcc3 /bin/sh ./depcomp \
	/usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I. -DDATADIR="\"/opt/local/share\""  -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk  -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64 -c `test -f 'eval.c' || echo './'`eval.c
source='output.c' object='output.o' libtool=no \
	depfile='.deps/output.Po' tmpdepfile='.deps/output.TPo' \
	depmode=gcc3 /bin/sh ./depcomp \
	/usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I. -DDATADIR="\"/opt/local/share\""  -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk  -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64 -c `test -f 'output.c' || echo './'`output.c
source='index.c' object='index.o' libtool=no \
	depfile='.deps/index.Po' tmpdepfile='.deps/index.TPo' \
	depmode=gcc3 /bin/sh ./depcomp \
	/usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I. -DDATADIR="\"/opt/local/share\""  -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk  -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64 -c `test -f 'index.c' || echo './'`index.c
source='sysdeps.c' object='sysdeps.o' libtool=no \
	depfile='.deps/sysdeps.Po' tmpdepfile='.deps/sysdeps.TPo' \
	depmode=gcc3 /bin/sh ./depcomp \
	/usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I. -DDATADIR="\"/opt/local/share\""  -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk  -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64 -c `test -f 'sysdeps.c' || echo './'`sysdeps.c
source='index_main.c' object='index_main.o' libtool=no \
	depfile='.deps/index_main.Po' tmpdepfile='.deps/index_main.TPo' \
	depmode=gcc3 /bin/sh ./depcomp \
	/usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I. -DDATADIR="\"/opt/local/share\""  -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk  -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64 -c `test -f 'index_main.c' || echo './'`index_main.c
index.c:317:5: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
           writer->hash_size*sizeof(IndexBuffer*)/1024);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index.c:319:5: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
           writer->terms*sizeof(IndexBuffer)/1024);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index_main.c:84:7: error: implicitly declaring library function 'strcmp' with type 'int (const char *, const char *)' [-Werror,-Wimplicit-function-declaration]
                if (strcmp(*argv,"--")==0) return i+1;
                    ^
index_main.c:84:7: note: include the header <string.h> or explicitly provide a declaration for 'strcmp'
index_main.c:241:6: error: implicit declaration of function 'index_query' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        if (index_query(&options,argc-end_options,argv+end_options)
            ^
2 errors generated.
sgml.c:604:26: warning: initializing 'const unsigned char *' with an expression of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
    const unsigned char *ptr=string_to_char(scanner->pi)+4;
                         ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index.c:625:23: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
    if ((writer->terms==writer->hash_size*2)) {
         ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
index.c:625:23: note: remove extraneous parentheses around the comparison to silence this warning
    if ((writer->terms==writer->hash_size*2)) {
        ~             ^                    ~
index.c:625:23: note: use '=' to turn this equality comparison into an assignment
    if ((writer->terms==writer->hash_size*2)) {
                      ^~
                      =
make[1]: *** [index_main.o] Error 1
make[1]: *** Waiting for unfinished jobs....
index.c:829:3: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
                writer->spool_size*sizeof(struct IndexBlock)/1024);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sysdeps.c:490:23: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
                stats.memory_blocks,stats.memory_allocated);
                                    ^~~~~~~~~~~~~~~~~~~~~~
./sgrep.h:395:15: note: expanded from macro 'stats'
#define stats (sgrep->statistics)
              ^
sysdeps.c:496:53: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
                    "\t%s:%d: %d bytes\n",block->file,block->line,block->size);
                              ~~                                  ^~~~~~~~~~~
                              %zu
main.c:945:3: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
                stats.peak_memory_usage/1024,stats.reallocs);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./sgrep.h:395:15: note: expanded from macro 'stats'
#define stats (sgrep->statistics)
              ^
index.c:1817:21: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
                   imap->filename,imap->size/1024,imap->len);
                                  ^~~~~~~~~~~~~~~
2 warnings generated.
1 warning generated.
5 warnings generated.
1 warning generated.
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_sgrep2/sgrep2/work/sgrep-1.94a'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_sgrep2/sgrep2/work/sgrep-1.94a'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_sgrep2/sgrep2/work/sgrep-1.94a" && /usr/bin/make -j16 -w all 
Exit code: 2
Error: Failed to build sgrep2: command execution failed
DEBUG: Error code: CHILDSTATUS 28199 2

Change History (1)

comment:1 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In d9e115803b133766b59d3a55851d913061085d84/macports-ports (master):

sgrep2: Fix implicit declaration of functions

Closes: #62344

Also add revision line, modernize checksums, use https for homepage,
remove offline master_sites entry, and fix livecheck.

Note: See TracTickets for help on using tickets.