Hi,

There are currently two occurrences of the __unused macro, one in 
aarch64.c which can go away (since the function is actually used) and 
one in armv8.c, which exists specifically to suppress the "unused 
function" warning while allowing the compiler to evaluate the tagged 
functions. I can't integrate these functions right now but I want them to 
be built in order to prevent bitrot. Since the CI used to break on 
warnings, I "__unused" the functions to suppress the warning.

Suggestion:
- surround the #define __unused with an "#ifndef __unused" bracket, 
that should fix the problem for MacOS (the #defines are obviously 
compatible).

The __unused will go away in a while, once I decide what to do with the 
currently unused functions in armv8.c.

BR,
Matthias

On Monday 24 April 2017 12:14:07 Freddie Chopin wrote:


I just (mistakenly) assumed that the __unused macro is for function 
arguments, just because this is the most common situation for me (; If 
this is used for functions then this is entirely different matter indeed.
This is the commit which introduced the macro - 
http://repo.or.cz/openocd.git?a=commit;h=bf1efe05bb71b7a6fe4ec1809
a6aaa9b6073aede[1]
Can we somehow notify Mathias about this problem, so that he could 
give his opinion?
--------------------
*[tickets:#151][2] OpenOCD fails to build on macOS due to redefined 
macro*
*Status:* new

*Milestone:* 0.9.0

*Created:* Sun Apr 23, 2017 10:07 PM UTC by Girts F

*Last Updated:* Mon Apr 24, 2017 05:47 AM UTC

*Owner:* nobody
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I./src -I./src -I./src/helper -
DPKGDATADIR=\"/usr/local/share/openocd\" -DBINDIR=\"/usr/local/bin\" 
-I./jimtcl -I./jimtcl -Wall -Wstrict-prototypes -Wformat-security -Wshadow -
Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -
Wredundant-decls -Werror -g -O2 -MT 
src/target/openrisc/or1k_tap_xilinx_bscan.lo -MD -MP -MF 
src/target/openrisc/.deps/or1k_tap_xilinx_bscan.Tpo -c 
src/target/openrisc/or1k_tap_xilinx_bscan.c -o 
src/target/openrisc/or1k_tap_xilinx_bscan.o
src/target/aarch64.c:33:9: error: '__unused' macro redefined [-Werror,-
Wmacro-redefined]
#define __unused __attribute((unused))
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platfor
m/Developer/SDKs/MacOSX10.12.sdk/usr/include/sys/cdefs.h:161:9: 
note: previous
      definition is here
#define __unused        __attribute__((unused))
        ^
1 error generated.
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.   
-I./src -I./src -I./src/helper -DPKGDATADIR=\"/usr/local/share/openocd\" -
DBINDIR=\"/usr/local/bin\" -I./jimtcl -I./jimtcl  -Wall -Wstrict-prototypes -
Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-
function-cast -Wcast-align -Wredundant-decls -Werror  -g -O2 -MT 
src/server/src_server_libserver_la-telnet_server.lo -MD -MP -MF 
src/server/.deps/src_server_libserver_la-telnet_server.Tpo -c -o 
src/server/src_server_libserver_la-telnet_server.lo `test -f 
'src/server/telnet_server.c' || echo './'`src/server/telnet_server.c
make[2]: *** [src/target/aarch64.lo] Error 1 
This is on macOS 10.12.4 at commit 
8addd9503eeb7704907d2340378d1200e3bbb99c.
CC version:
$ gcc --version
Configured with: --
prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-
include-
dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.plat
form/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.x
ctoolchain/usr/bin 
--------------------
Sent from sourceforge.net because openocd-
de...@lists.sourceforge.net is subscribed to 
https://sourceforge.net/p/openocd/tickets/[3]
To unsubscribe from further messages, a project admin can change 
settings at https://sourceforge.net/p/openocd/admin/tickets/options.[4] 
Or, if this is a mailing list, you can unsubscribe from the mailing list.



--------
[1] 
http://repo.or.cz/openocd.git?a=commit;h=bf1efe05bb71b7a6fe4ec1809
a6aaa9b6073aede
[2] https://sourceforge.net/p/openocd/tickets/151/
[3] https://sourceforge.net/p/openocd/tickets/
[4] https://sourceforge.net/p/openocd/admin/tickets/options.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to