From eeb84fbbc7fcb3df8e66fb73b28acc5ab323998c Mon Sep 17 00:00:00 2001
From: Erik Strand <erik@erikstrand.net>
Date: Thu, 26 Dec 2019 22:33:36 -0500
Subject: [PATCH] Note compilation error that happens with clang

---
 openocd/README.md | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/openocd/README.md b/openocd/README.md
index 0c2287d..c2f67de 100644
--- a/openocd/README.md
+++ b/openocd/README.md
@@ -36,9 +36,10 @@ is on SourceForge.
 
 ```git clone https://git.code.sf.net/p/openocd/code openocd-code```
 
-To build it, you'll need `gcc` or `clang`, as well as `make`, `libtool`, `pkg-config` version 0.23
+To build it, you'll need `gcc`, as well as `make`, `libtool`, `pkg-config` version 0.23
 or greater, and possibly others detailed [here](http://openocd.org/doc-release/README). Once you
-have the prereqs, building is a standard process. Just note that you need to enable cmsis-dap, which is the protocol your computer will use to communicate with an ATMEL ICE debugger.
+have the prereqs, building is a standard process. Just note that you need to enable cmsis-dap,
+which is the protocol your computer will use to communicate with an ATMEL ICE debugger.
 
 ```
 ./bootstrap
@@ -47,6 +48,15 @@ make
 make install
 ```
 
+Compiler note: you should be able to use `clang`, but it doesn't seem to work (at least on Mac).
+I get the following error:
+
+```
+src/flash/nor/nrf5.c:613:5: error: format specifies type 'unsigned short' but the argument has type 'uint32_t' (aka 'unsigned int') [-Werror,-Wformat]
+```
+To fix it, tell the configuration script to use gcc: `/configure --enable-cmsis-dap CC=gcc-8` (or whatever gcc you have installed).
+Note that the default `gcc` command on Mac is not actually `gcc`; it's `clang`. So you'll have to install it if you haven't already.
+
 ### Additional Setup
 
 You'll almost certainly end up needing a handful of other helpful tools. Depending on your other
-- 
GitLab