IDE 1.6.9 upgrade creating error expected unqualified-id before numeric constant

Hi,
Any help would be appreciated with a recent upgrade to 1.6.9 IDE with a sketch now failing to compile. Changing the variable name enables the compile but I am unclear as to why this code is a problem. To target the problem away from general code problems and find the issue I cut the sketch down to a single const variable declaration and still get the following error message

"exit status 1
expected unqualified-id before numeric constant" with the following sketch. [actually just the int definition].

const int BUFSIZ =90;

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

changing the const int to another name allows the compile to take place or even just changing the case. I have updated many of the libraries with the IDE [love that feature] but get the following error message which leads me to think it is a library issue.

Arduino: 1.6.9 (Windows XP), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

M:\Critical Backups\Arduino\arduino-builder -dump-prefs -logger=machine -hardware "M:\Critical Backups\Arduino\hardware" -hardware "C:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages" -tools "M:\Critical Backups\Arduino\tools-builder" -tools "M:\Critical Backups\Arduino\hardware\tools\avr" -tools "C:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages" -built-in-libraries "M:\Critical Backups\Arduino\libraries" -libraries "M:\Critical Backups\Arduino House\libraries" -fqbn=arduino:avr:mega:cpu=atmega2560 -ide-version=10609 -build-path "C:\DOCUME~1\Chris\LOCALS~1\Temp\build0947400bff2a21e009cefcbda5ac6b7e.tmp" -warnings=all -prefs=build.warn_data_percentage=75 -verbose "C:\DOCUME~1\Chris\LOCALS~1\Temp\arduino_modified_sketch_908364\sketch_sep28a.ino"
M:\Critical Backups\Arduino\arduino-builder -compile -logger=machine -hardware "M:\Critical Backups\Arduino\hardware" -hardware "C:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages" -tools "M:\Critical Backups\Arduino\tools-builder" -tools "M:\Critical Backups\Arduino\hardware\tools\avr" -tools "C:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages" -built-in-libraries "M:\Critical Backups\Arduino\libraries" -libraries "M:\Critical Backups\Arduino House\libraries" -fqbn=arduino:avr:mega:cpu=atmega2560 -ide-version=10609 -build-path "C:\DOCUME~1\Chris\LOCALS~1\Temp\build0947400bff2a21e009cefcbda5ac6b7e.tmp" -warnings=all -prefs=build.warn_data_percentage=75 -verbose "C:\DOCUME~1\Chris\LOCALS~1\Temp\arduino_modified_sketch_908364\sketch_sep28a.ino"
"C:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   "-IC:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.13\cores\arduino" "-IC:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.13\variants\mega" "C:\DOCUME~1\Chris\LOCALS~1\Temp\build0947400bff2a21e009cefcbda5ac6b7e.tmp\sketch\sketch_sep28a.ino.cpp" -o "nul"
"C:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   "-IC:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.13\cores\arduino" "-IC:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.13\variants\mega" "C:\DOCUME~1\Chris\LOCALS~1\Temp\build0947400bff2a21e009cefcbda5ac6b7e.tmp\sketch\sketch_sep28a.ino.cpp" -o "nul"
"C:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   "-IC:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.13\cores\arduino" "-IC:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.13\variants\mega" "C:\DOCUME~1\Chris\LOCALS~1\Temp\build0947400bff2a21e009cefcbda5ac6b7e.tmp\sketch\sketch_sep28a.ino.cpp" -o "C:\DOCUME~1\Chris\LOCALS~1\Temp\build0947400bff2a21e009cefcbda5ac6b7e.tmp\preproc\ctags_target_for_gcc_minus_e.cpp"
"M:\Critical Backups\Arduino\tools-builder\ctags\5.8-arduino10/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\DOCUME~1\Chris\LOCALS~1\Temp\build0947400bff2a21e009cefcbda5ac6b7e.tmp\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   "-IC:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.13\cores\arduino" "-IC:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.13\variants\mega" "C:\DOCUME~1\Chris\LOCALS~1\Temp\build0947400bff2a21e009cefcbda5ac6b7e.tmp\sketch\sketch_sep28a.ino.cpp" -o "C:\DOCUME~1\Chris\LOCALS~1\Temp\build0947400bff2a21e009cefcbda5ac6b7e.tmp\sketch\sketch_sep28a.ino.cpp.o"
In file included from C:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.13\cores\arduino/Print.h:24:0,

                 from C:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.13\cores\arduino/Stream.h:26,

                 from C:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.13\cores\arduino/HardwareSerial.h:29,

                 from C:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.13\cores\arduino/Arduino.h:224,

                 from C:\DOCUME~1\Chris\LOCALS~1\Temp\build0947400bff2a21e009cefcbda5ac6b7e.tmp\sketch\sketch_sep28a.ino.cpp:1:

sketch_sep28a:2: error: expected unqualified-id before numeric constant

 const int BUFSIZ =90;

           ^

exit status 1
expected unqualified-id before numeric constant

I have read several forums about avr issues and I am not certain if this is a library installation/upgrade issue or an IDE configuration issue, or a bug within a library. What is interesting is that it is associated only with this definition of BUFSIZ as another variable name compiles fine. I know that I can change the variable BUFSIZ name but have a lot of sketches using this variable and I am wondering if the other error messages can lead to a solution. Is BUFSIZ now a reserved word in IDE 1.6.9?

Changing to BUFSIZe compiles ok.

I am using a Mega and the IDE on an windows XP machine with multiple drives. Any advice would be greatly appreciated or any suggestions for me to look into. Thanks in advance. Chris :slight_smile:

It's actually not Arduino IDE 1.6.9 that did it, it was an update of Arduino AVR Boards you must have done and forgotten about because the toolchain included with Arduino IDE 1.6.9 doesn't contain that macro but Arduino AVR Boards 1.6.12 and higher does.
It's at line 948 of C:\Documents and Settings\Chris\Local Settings\Application Data\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2\avr\include\stdio.h:

#define BUFSIZ 1024

which causes your code to translate to:

const int 1024=90;

after the preprocessor is done with it so you can see the reason for the error.

In general I'd recommend reserving all caps for macros. The Arduino style is to use camel case for constants, variables and functions. This will reduce the chances for conflict. Caps are more work to type anyway.

Brilliant! Thanks for the info, much appreciated.