Opened 3 years ago

Closed 3 years ago

#62300 closed defect (fixed)

byaccj @1.15_1: error: implicit declaration of function 'unlink' is invalid in C99

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

Description

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

make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_byaccj/byaccj/work/byaccj1.15/src'
/usr/bin/clang -arch x86_64 -c -Os -I. closure.c -o closure.o
/usr/bin/clang -arch x86_64 -c -Os -I. error.c -o error.o
/usr/bin/clang -arch x86_64 -c -Os -I. lalr.c -o lalr.o
/usr/bin/clang -arch x86_64 -c -Os -I. lr0.c -o lr0.o
/usr/bin/clang -arch x86_64 -c -Os -I. main.c -o main.o
/usr/bin/clang -arch x86_64 -c -Os -I. mkpar.c -o mkpar.o
/usr/bin/clang -arch x86_64 -c -Os -I. output.c -o output.o
/usr/bin/clang -arch x86_64 -c -Os -I. reader.c -o reader.o
/usr/bin/clang -arch x86_64 -c -Os -I. skeleton.c -o skeleton.o
/usr/bin/clang -arch x86_64 -c -Os -I. symtab.c -o symtab.o
/usr/bin/clang -arch x86_64 -c -Os -I. verbose.c -o verbose.o
/usr/bin/clang -arch x86_64 -c -Os -I. warshall.c -o warshall.o
main.c:88:43: error: implicit declaration of function 'unlink' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  if (action_file) { fclose(action_file); unlink(action_file_name); }
                                          ^
main.c:89:39: error: implicit declaration of function 'unlink' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  if (text_file) { fclose(text_file); unlink(text_file_name); }
                                      ^
main.c:90:41: error: implicit declaration of function 'unlink' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  if (union_file) { fclose(union_file); unlink(union_file_name); }
                                        ^
main.c:481:2: error: implicit declaration of function 'unlink' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        unlink(temp_output_file_name);
        ^
mkpar.c:179:2: warning: add explicit braces to avoid dangling else [-Wdangling-else]
        else
        ^
reader.c:320:7: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      else
      ^
4 errors generated.
reader.c:451:7: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      else
      ^
output.c:846:30: warning: data argument not used by format string [-Wformat-extra-args]
        fprintf(defines_file, "}\n",jclass_name,JAVA_INTERFACE_SUFFIX);    
                              ~~~~~ ^
output.c:875:7: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      else
      ^
make: *** [main.o] Error 1
make: *** Waiting for unfinished jobs....
reader.c:1262:7: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      else
      ^
output.c:1439:2: warning: add explicit braces to avoid dangling else [-Wdangling-else]
        else
        ^
output.c:1479:2: warning: add explicit braces to avoid dangling else [-Wdangling-else]
        else
        ^
1 warning generated.
4 warnings generated.
3 warnings generated.
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_byaccj/byaccj/work/byaccj1.15/src'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_byaccj/byaccj/work/byaccj1.15/src" && /usr/bin/make -j16 -w all CC="/usr/bin/clang -arch x86_64" CFLAGS="-Os" LDFLAGS="-L/opt/local/lib -Wl,-headerpad_max_install_names" 
Exit code: 2
Error: Failed to build byaccj: command execution failed
DEBUG: Error code: CHILDSTATUS 41425 2

Change History (2)

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

Keywords: bigsur catalina added

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

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In 46cd099c945e81fa7b0fa4a3643eb039cd641746/macports-ports (master):

byaccj: Fix implicit declaration of function

Closes: #62300

Also modernize checksums, rename patchfile, and use 0 prefix for octal
numbers.

Note: See TracTickets for help on using tickets.