Skip to content

Fix compilation error caused by missing function prototypes #92

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oriyadid
Copy link

Change description

This PR resolves an issue in the previous commit (8d62e99), which introduced a nasm_err_helpers(void, note, ERR_NOTE) line to error.c, without declaring the corresponding functions generated by the helper macro (nasm_note and nasm_notef).

Error message

When building the project with make, the following error is outputted:

gcc -c -std=c17 -Werror=attributes -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -ggdb3 -fwrapv -ftrivial-auto-var-init=zero -U__STRICT_ANSI__ -fno-common -ffunction-sections -fdata-sections -fvisibility=hidden -Wall -W -pedantic -Werror=implicit -Werror=missing-braces -Werror=return-type -Werror=trigraphs -Werror=pointer-arith -Werror=strict-prototypes -Werror=missing-prototypes -Werror=missing-declarations -Werror=comment -Werror=vla -Wno-variadic-macros -Wno-long-long -Wno-stringop-truncation -Wno-shift-negative-value -DHAVE_CONFIG_H -I. -I. -I./include -I./include -I./x86 -I./x86 -I./asm -I./asm -I./disasm -I./disasm -I./output -I./output -o asm/error.o asm/error.c
asm/error.c:63:7: error: no previous prototype for ‘nasm_notef’ [-Werror=missing-prototypes]
   63 | _type nasm_ ## _name ## f (errflags flags, const char *fmt, ...)        \
      |       ^~~~~
asm/error.c:73:1: note: in expansion of macro ‘nasm_err_helpers’
   73 | nasm_err_helpers(void,       note,     ERR_NOTE)
      | ^~~~~~~~~~~~~~~~
asm/error.c:67:7: error: no previous prototype for ‘nasm_note’ [-Werror=missing-prototypes]
   67 | _type nasm_ ## _name (const char *fmt, ...)                             \
      |       ^~~~~
asm/error.c:73:1: note: in expansion of macro ‘nasm_err_helpers’
   73 | nasm_err_helpers(void,       note,     ERR_NOTE)
      | ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

Steps to reproduce (x86_64 bit Linux, GCC 14.2.1)

  1. Freshly clone nasm
  2. Checkout the relevant commit via git checkout 8d62e99e140f20dcab6d1568fe9b3734b5f3b61d (latest commit at the time of creating this PR)
  3. Run ./autogen.sh && ./configure
  4. Simply attempt to build the project with make

I sincerely apologise if this is not the intended way to submit bug-fixes or pull-requests. This is my first contribution to this project.

This resolves an issue in the previous commit, which introduced a `nasm_err_helpers(void, note, ERR_NOTE)` line to `error.c`, without declaring the corresponding functions generated by the helper macro (`nasm_note` and `nasm_notef`).

Signed-off-by: Ori Yadid <yaoriya@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant