capstone-engine / capstone

Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore and X86.
http://www.capstone-engine.org
7.27k stars 1.53k forks source link

Compilation warning in cstool.c using "make.sh debug" on AARCH64 Linux #1956

Closed PerMildner closed 1 year ago

PerMildner commented 1 year ago

Building with make.sh debug gives warnings. This does not happen when just using make.sh without arguments.

This is master branch (9e27c51c2485dd37dd3917919ae781c6153f3688).

Some of the symptoms look similar to those in #1737.

$ git clone --branch 'master' 'https://github.com/capstone-engine/capstone.git'
Cloning into 'capstone'...
...
$ cd capstone
$ ./make.sh debug
  CC      cs.o
  ...
ar: creating ./libcapstone.a
make[1]: Entering directory '/home/spdev/capstone/cstool'
  CC      cstool_arm64.o
  CC      cstool_arm.o
  CC      cstool.o
  CC      cstool_evm.o
In file included from cstool.c:7:
getopt.h:20:1: warning: no previous prototype for ‘getopt’ [-Wmissing-prototypes]
   20 | getopt (int nargc, char * const nargv[], const char *ostr)
      | ^~~~~~
cstool_arm64.c:11:6: warning: no previous prototype for ‘print_insn_detail_arm64’ [-Wmissing-prototypes]
   11 | void print_insn_detail_arm64(csh handle, cs_insn *ins)
      |      ^~~~~~~~~~~~~~~~~~~~~~~
cstool.c:79:6: warning: no previous prototype for ‘print_string_hex’ [-Wmissing-prototypes]
   79 | void print_string_hex(const char *comment, unsigned char *str, size_t len)
      |      ^~~~~~~~~~~~~~~~
cstool_arm.c:8:6: warning: no previous prototype for ‘print_insn_detail_arm’ [-Wmissing-prototypes]
    8 | void print_insn_detail_arm(csh handle, cs_insn *ins)
      |      ^~~~~~~~~~~~~~~~~~~~~
cstool_evm.c:8:6: warning: no previous prototype for ‘print_insn_detail_evm’ [-Wmissing-prototypes]
    8 | void print_insn_detail_evm(csh handle, cs_insn *ins)
      |      ^~~~~~~~~~~~~~~~~~~~~
  CC      cstool_m680x.o
  CC      cstool_m68k.o
  CC      cstool_mips.o
  CC      cstool_mos65xx.o
cstool_m680x.c:13:6: warning: no previous prototype for ‘print_read_write_regs’ [-Wmissing-prototypes]
   13 | void print_read_write_regs(csh handle, cs_detail *detail)
      |      ^~~~~~~~~~~~~~~~~~~~~
cstool_m680x.c:45:6: warning: no previous prototype for ‘print_insn_detail_m680x’ [-Wmissing-prototypes]
   45 | void print_insn_detail_m680x(csh handle, cs_insn *insn)
      |      ^~~~~~~~~~~~~~~~~~~~~~~
cstool_m68k.c:61:6: warning: no previous prototype for ‘print_insn_detail_m68k’ [-Wmissing-prototypes]
   61 | void print_insn_detail_m68k(csh handle, cs_insn *ins)
      |      ^~~~~~~~~~~~~~~~~~~~~~
cstool_mos65xx.c:44:6: warning: no previous prototype for ‘print_insn_detail_mos65xx’ [-Wmissing-prototypes]
   44 | void print_insn_detail_mos65xx(csh handle, cs_insn *ins)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~
cstool_mips.c:11:6: warning: no previous prototype for ‘print_insn_detail_mips’ [-Wmissing-prototypes]
   11 | void print_insn_detail_mips(csh handle, cs_insn *ins)
      |      ^~~~~~~~~~~~~~~~~~~~~~
  CC      cstool_ppc.o
  CC      cstool_sparc.o
  CC      cstool_systemz.o
  CC      cstool_tms320c64x.o
cstool_ppc.c:39:6: warning: no previous prototype for ‘print_insn_detail_ppc’ [-Wmissing-prototypes]
   39 | void print_insn_detail_ppc(csh handle, cs_insn *ins)
      |      ^~~~~~~~~~~~~~~~~~~~~
cstool_systemz.c:10:6: warning: no previous prototype for ‘print_insn_detail_sysz’ [-Wmissing-prototypes]
   10 | void print_insn_detail_sysz(csh handle, cs_insn *ins)
      |      ^~~~~~~~~~~~~~~~~~~~~~
cstool_tms320c64x.c:9:6: warning: no previous prototype for ‘print_insn_detail_tms320c64x’ [-Wmissing-prototypes]
    9 | void print_insn_detail_tms320c64x(csh handle, cs_insn *ins)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
cstool_sparc.c:10:6: warning: no previous prototype for ‘print_insn_detail_sparc’ [-Wmissing-prototypes]
   10 | void print_insn_detail_sparc(csh handle, cs_insn *ins)
      |      ^~~~~~~~~~~~~~~~~~~~~~~
  CC      cstool_x86.o
  CC      cstool_xcore.o
cstool_x86.c:180:6: warning: no previous prototype for ‘print_insn_detail_x86’ [-Wmissing-prototypes]
  180 | void print_insn_detail_x86(csh ud, cs_mode mode, cs_insn *ins)
      |      ^~~~~~~~~~~~~~~~~~~~~
cstool_xcore.c:9:6: warning: no previous prototype for ‘print_insn_detail_xcore’ [-Wmissing-prototypes]
    9 | void print_insn_detail_xcore(csh handle, cs_insn *ins)
      |      ^~~~~~~~~~~~~~~~~~~~~~~
  LINK    cstool
make[1]: Leaving directory '/home/spdev/capstone/cstool'
make -C tests
make[1]: Entering directory '/home/spdev/capstone/tests'
  CC      test_basic.o
  ...
  LINK    test_mos65xx.static
make[1]: Leaving directory '/home/spdev/capstone/tests'
make -C suite/fuzz
make[1]: Entering directory '/home/spdev/capstone/suite/fuzz'
  CC      fuzz_disasm.o
  CC      drivermc.o
  CC      driverbin.o
  LINK    fuzz_disasm
  LINK    fuzz_bindisasm
make[1]: Leaving directory '/home/spdev/capstone/suite/fuzz'
install -m0755 ./libcapstone.so.5 ./tests/
cd ./tests/ && rm -f libcapstone.so && ln -s libcapstone.so.5 libcapstone.so
$ uname -a
Linux ... 5.15.0-1027-oracle #33-Ubuntu SMP Fri Jan 6 16:30:16 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
$ cc --version
cc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
...

$ 
PerMildner commented 1 year ago

This does not happen in the next branch (6eb1db9c04113ac0a05f2dfd228704c84775530f), so closing as obsolete. Sorry for noise.