Can I ask you or some other Xcode/Makefile craig again if you have some clues?
I discovered the following:
When I add in main.cpp the full path of BlinkTest.ino (i.e. #include"/Users/myname/Documents/Arduino/BlinkTest/BlinkTest/BlinkTest.ino") the test project compiles in the Arduino IDE.
The warnings are still present. They appear in Libraries HardwareSerial.cpp, Print.cpp and Tone.cpp which are included from a previous compile (although I installed the whole Arduino.app new).
E.g. the last lines of the compiler output before the warnings are:
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=102 \
-I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino \
-I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/mega /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/HardwareSerial.cpp \
-o /var/folders/gq/_c97z0614fj267w8732pn4r00000gn/T/build4731805130703822254.tmp/HardwareSerial.cpp.o
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/HardwareSerial.cpp: In function 'void store_char(unsigned char, ring_buffer*)':
I suspect this may be independent from the build errors in XCode, but on the other hand, I was able to avoid all warnings in previous sketches.
What I also observed: If I insert some rubbish into the main.cpp (either within main{} or outside), it is not picked up during the build target, at all. This can be because it lists too many other errors and parses all includes, first, but may still be a clue.
I still believe this may be some problem with errors due to function overloading which would normally work in C++ (maybe some functions are not interpreted as being part of a class ??)
If I look at the first bit that generates an error:
#ifdef __cplusplus
#include "WCharacter.h"
#include "WString.h"
#include "HardwareSerial.h"
uint16_t makeWord(uint16_t w);
uint16_t makeWord(byte h, byte l);
#define word(...) makeWord(__VA_ARGS__)
Which is some part of Arduino.h I get the first error in the lower line of uint16_t makeWord saying Declaration of C function 'uint16_t makeWord(byte, byte)' conflicts with and in the line above the error is Previous declaration 'uint16_t makeWord(uint16_t)' here.
I also included in Arduino1.mk the line $(shell env>theEnvironment)
and the anonymized result is attached...
Thank you anyone for your help.
theEnvironment.txt (9.91 KB)