Closed jdn06 closed 8 years ago
What is the version of clang?
I've tried clang 3.8 on Debian and it works fine with no error out of git head.
Default on FreeBSD 10.2 is clang version 3.4.1. I install a more recent one to try.
At least on Debian clang with clang 3.4.2-15 compilation works.
It could be an issue with the freebsd specific code though, I'll try to see if I can spin up a FreeBSD vm to test this.
I tried with clang 3.8 and have the same error. I post the numerous warnings before the error, if it can help:
[24/31] CC built/arch/arch-freebsd.o
In file included from arch/arch-freebsd.c:7:
arch/arch-posix.c:73:34: warning: unused parameter 'dev' [-Wunused-parameter]
void disk_dev_cdb_in(disk_dev_t *dev, unsigned char *cdb, unsigned cdb_len, unsigned char *buf, unsigned buf_size, unsigned *buf_read, unsigned char *sense, unsigned sense_size, unsigned *sense_read, io_result_t *io_res)
^
arch/arch-posix.c:73:54: warning: unused parameter 'cdb' [-Wunused-parameter]
void disk_dev_cdb_in(disk_dev_t *dev, unsigned char *cdb, unsigned cdb_len, unsigned char *buf, unsigned buf_size, unsigned *buf_read, unsigned char *sense, unsigned sense_size, unsigned *sense_read, io_result_t *io_res)
^
arch/arch-posix.c:73:68: warning: unused parameter 'cdb_len' [-Wunused-parameter]
void disk_dev_cdb_in(disk_dev_t *dev, unsigned char *cdb, unsigned cdb_len, unsigned char *buf, unsigned buf_size, unsigned *buf_read, unsigned char *sense, unsigned sense_size, unsigned *sense_read, io_result_t *io_res)
^
arch/arch-posix.c:73:92: warning: unused parameter 'buf' [-Wunused-parameter]
void disk_dev_cdb_in(disk_dev_t *dev, unsigned char *cdb, unsigned cdb_len, unsigned char *buf, unsigned buf_size, unsigned *buf_read, unsigned char *sense, unsigned sense_size, unsigned *sense_read, io_result_t *io_res)
^
arch/arch-posix.c:73:106: warning: unused parameter 'buf_size' [-Wunused-parameter]
void disk_dev_cdb_in(disk_dev_t *dev, unsigned char *cdb, unsigned cdb_len, unsigned char *buf, unsigned buf_size, unsigned *buf_read, unsigned char *sense, unsigned sense_size, unsigned *sense_read, io_result_t *io_res)
^
arch/arch-posix.c:73:126: warning: unused parameter 'buf_read' [-Wunused-parameter]
void disk_dev_cdb_in(disk_dev_t *dev, unsigned char *cdb, unsigned cdb_len, unsigned char *buf, unsigned buf_size, unsigned *buf_read, unsigned char *sense, unsigned sense_size, unsigned *sense_read, io_result_t *io_res)
^
arch/arch-posix.c:73:151: warning: unused parameter 'sense' [-Wunused-parameter]
void disk_dev_cdb_in(disk_dev_t *dev, unsigned char *cdb, unsigned cdb_len, unsigned char *buf, unsigned buf_size, unsigned *buf_read, unsigned char *sense, unsigned sense_size, unsigned *sense_read, io_result_t *io_res)
^
arch/arch-posix.c:73:167: warning: unused parameter 'sense_size' [-Wunused-parameter]
void disk_dev_cdb_in(disk_dev_t *dev, unsigned char *cdb, unsigned cdb_len, unsigned char *buf, unsigned buf_size, unsigned *buf_read, unsigned char *sense, unsigned sense_size, unsigned *sense_read, io_result_t *io_res)
^
arch/arch-posix.c:73:189: warning: unused parameter 'sense_read' [-Wunused-parameter]
void disk_dev_cdb_in(disk_dev_t *dev, unsigned char *cdb, unsigned cdb_len, unsigned char *buf, unsigned buf_size, unsigned *buf_read, unsigned char *sense, unsigned sense_size, unsigned *sense_read, io_result_t *io_res)
^
9 warnings generated.
[29/31] CTAGS tags
Duplicate entry in file lib/sha1.c, line 101: blk0
Second entry ignored
Duplicate entry in file lib/sha1.c, line 335: Msha1
Second entry ignored
Duplicate entry in file hdrhistogram/src/hdr_histogram_log.c, line 190: __attribute__
Second entry ignored
Duplicate entry in file hdrhistogram/src/hdr_histogram_log.c, line 202: __attribute__
Second entry ignored
Duplicate entry in file include/compiler.h, line 7: UNUSED
Second entry ignored
[31/31] LINK diskscan
FAILED: /usr/local/bin/clang-devel -o diskscan built/cli/cli.o built/cli/verbose.o built/progressbar/lib/progressbar.o built/diskscan.o libdiskscan.a libscsicmd.a -ltermcap -lm -lz
libdiskscan.a(diskscan.o): In function `disk_open':
/home/jd/Programmes/diskscan-0.17/lib/diskscan.c:316: undefined reference to `disk_dev_identify'
libdiskscan.a(system_id.o): In function `system_identifier_read':
/home/jd/Programmes/diskscan-0.17/lib/system_id.c:97: undefined reference to `mac_read'
clang-3.8: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
I'll spin up a FreeBSD VM later to check this out.
OK Thank you!
The last two declarations in include/arch.h seem ignored, what produces an error when building:
I don't see why, but I am not a programmer...