Opened 4 years ago

Closed 4 years ago

#62250 closed defect (fixed)

bdump @3.5: error: implicitly declaring library function 'isdigit'

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: bdump

Description

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

--->  Building bdump
DEBUG: Executing org.macports.build (bdump)
DEBUG: system -W /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_bdump/bdump/work/bdump: /usr/bin/clang -Os -arch x86_64 bdump.c -o bdump
bdump.c:183:22: error: implicitly declaring library function 'isdigit' with type 'int (int)' [-Werror,-Wimplicit-function-declaration]
            else if (isdigit (*optarg))
                     ^
bdump.c:183:22: note: include the header <ctype.h> or explicitly provide a declaration for 'isdigit'
bdump.c:190:17: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
                exit (1);
                ^
bdump.c:190:17: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
bdump.c:244:50: error: implicitly declaring library function 'tolower' with type 'int (int)' [-Werror,-Wimplicit-function-declaration]
                    if (Colours[i].charOption == tolower (*optarg))
                                                 ^
bdump.c:244:50: note: include the header <ctype.h> or explicitly provide a declaration for 'tolower'
bdump.c:293:77: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
            fprintf (helpOut, "\t-n Narrow.   Display %d bytes per line\n", LONGS_PER_LINE_NARROW * sizeof (long));
                                                      ~~                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                      %lu
bdump.c:32:34: note: expanded from macro 'LONGS_PER_LINE_NARROW'
#define LONGS_PER_LINE_NARROW    4
                                 ^
bdump.c:294:87: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
            fprintf (helpOut, "\t-m Medium    Display %d bytes per line (default)\n", LONGS_PER_LINE_ORD * sizeof (long));
                                                      ~~                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                      %lu
bdump.c:30:34: note: expanded from macro 'LONGS_PER_LINE_ORD'
#define LONGS_PER_LINE_ORD       8
                                 ^
bdump.c:295:77: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
            fprintf (helpOut, "\t-w Wide.     Display %d bytes per line\n", LONGS_PER_LINE_WIDE * sizeof (long));
                                                      ~~                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                      %lu
bdump.c:31:33: note: expanded from macro 'LONGS_PER_LINE_WIDE'
#define LONGS_PER_LINE_WIDE     16
                                ^
bdump.c:448:25: error: implicitly declaring library function 'isprint' with type 'int (int)' [-Werror,-Wimplicit-function-declaration]
                    if (isprint (pntr[i]))
                        ^
bdump.c:448:25: note: include the header <ctype.h> or explicitly provide a declaration for 'isprint'
3 warnings and 4 errors generated.
Command failed: /usr/bin/clang -Os -arch x86_64 bdump.c -o bdump
Exit code: 1
Error: Failed to build bdump: command execution failed
DEBUG: Error code: NONE
DEBUG: Backtrace: command execution failed
    while executing
"$procedure $targetname"

Change History (2)

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

Keywords: bigsur catalina added
Summary: bdump @3.5: build failsbdump @3.5: error: implicitly declaring library function 'isdigit'

This is the well-known implicit declaration of function issue with Xcode 12 and later that needs to be fixed in the usual way (include the right headers in the right places).

comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In 57b38affdab1c37245c9a56b7d7de8bb8e01fb9d/macports-ports (master):

bdump: Fix implicit declaration of functions

Closes: #62250

Also add modeline and revision line, modernize checksums, and use 0
prefix for octal numbers.

Note: See TracTickets for help on using tickets.