Compile once: warning(s), Compile again: no warnings?

ninja2

Well-known member
Sometimes I get this warning on compile:
Code:
...\Documents\ARDUINO\SKETCHES\TEENSY\DS1307_teensy\RTC.cpp: In function 'byte RTC_WriteByte(int, byte)':
...\Documents\ARDUINO\SKETCHES\TEENSY\DS1307_teensy\RTC.cpp:284:3: warning: control reaches end of non-void function [-Wreturn-type]
  284 |   }
      |   ^

Other times I get many warnings, starting with the one above. In either case, if I immediately recompile (no edits), the warning dissappears.
If I do any edit the warning(s) will re-appear, the re-compile and they dissappear.

1) Is this normal behaviour?
2) in the example warning "warning: control reaches end of non-void function" probably means I have missed a semi-colon somwhere (for example). Then why does it compile immediately after?
 
Is the diff a clean versus a partial build/rebuild?

i.e.: Perhaps the RTC.CPP builds once with warnings and then it is not rebuilt on the next re-build as no dependency changed to cause a rebuild?
 
Not sure I understand "clean versus a partial build/rebuild"...
in case it is relevant: my sketch comprises 15 tabs, with one .ino and seven .cpp/.h pairs, one of which is named RTC.
(i.e. RTC.cpp is not a library component)

RTCmaster tabs.JPG


PS: the example warning is from a few days ago, and I've since moved the sketch from TEENSY to RTC folder.
 
Oh - and looking at that warning - do not ignore that!

Was online with @shawn the other month and made a void func() have a return and one path was not covered and got that warning that was not 'SEEN'.

Subsequent builds CRASHED for an 'unknown' reason - an hour later the path with no return was corrected and the crashes stopped.
 
Not sure I understand "clean versus a partial build/rebuild"...
Starting the IDE it makes a new TMP folder and will build EVERYTHING ... CLEAN.
On subsequent builds then the process will (ideally) not recompile anything that could not have changed where the build results stored in that TMP folder will be used in linking without recompiling them ... this would be a PARTIAL.

In the IDE is any board detail is changed: Optimize, USB Type, Processor Speed - then the IDE will to a clean rebuild of ALL.
If that doesn't happen then only changes to headers or sources that would affect other source files will be rebuilt ... ideally
 
Oh - and looking at that warning - do not ignore that!
now you've got my attention.

As mentioned, for "warning: control reaches end of non-void function" I think it means I have missed a semi-colon somewhere. but I can't find it. Any suggestions for resolving aprpeciated.

Here's a (sanitised) verbose compile from a few days ago. Not sure what I'm looking for?

Code:
FQBN: teensy:avr:teensy35
Using board 'teensy35' from platform in folder: ...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0
Using core 'teensy3' from platform in folder: ...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0

Detecting libraries used...
...\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3 ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\DS1307_teensy.ino.cpp -o nul
Alternatives for Wire.h: [Wire@1.0]
ResolveLibrary(Wire.h)
  -> candidates: [Wire@1.0]
...\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3 -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Wire ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\DS1307_teensy.ino.cpp -o nul
Alternatives for Streaming.h: [Streaming@6.1.1]
ResolveLibrary(Streaming.h)
  -> candidates: [Streaming@6.1.1]
...\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3 -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Wire -I...\Documents\ARDUINO\SKETCHES\libraries\Streaming\src ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\DS1307_teensy.ino.cpp -o nul
Alternatives for DS1307RTC.h: [DS1307RTC@1.4.1]
ResolveLibrary(DS1307RTC.h)
  -> candidates: [DS1307RTC@1.4.1]
...\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3 -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Wire -I...\Documents\ARDUINO\SKETCHES\libraries\Streaming\src -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\DS1307RTC ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\DS1307_teensy.ino.cpp -o nul
Alternatives for TimeLib.h: [Time@1.6.1]
ResolveLibrary(TimeLib.h)
  -> candidates: [Time@1.6.1]
...\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3 -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Wire -I...\Documents\ARDUINO\SKETCHES\libraries\Streaming\src -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\DS1307RTC -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Time ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\DS1307_teensy.ino.cpp -o nul
Alternatives for SPI.h: [SPI@1.0]
ResolveLibrary(SPI.h)
  -> candidates: [SPI@1.0]
...\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3 -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Wire -I...\Documents\ARDUINO\SKETCHES\libraries\Streaming\src -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\DS1307RTC -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Time -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\SPI ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\DS1307_teensy.ino.cpp -o nul
Alternatives for Adafruit_SSD1306.h: [Adafruit SSD1306@2.5.9]
ResolveLibrary(Adafruit_SSD1306.h)
  -> candidates: [Adafruit SSD1306@2.5.9]
...\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3 -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Wire -I...\Documents\ARDUINO\SKETCHES\libraries\Streaming\src -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\DS1307RTC -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Time -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\SPI -I...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_SSD1306 ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\DS1307_teensy.ino.cpp -o nul
Alternatives for Adafruit_GFX.h: [Adafruit GFX Library@1.11.9]
ResolveLibrary(Adafruit_GFX.h)
  -> candidates: [Adafruit GFX Library@1.11.9]
...\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3 -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Wire -I...\Documents\ARDUINO\SKETCHES\libraries\Streaming\src -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\DS1307RTC -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Time -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\SPI -I...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_SSD1306 -I...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_GFX_Library ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\DS1307_teensy.ino.cpp -o nul
Alternatives for Adafruit_I2CDevice.h: [Adafruit BusIO@1.15.0]
ResolveLibrary(Adafruit_I2CDevice.h)
  -> candidates: [Adafruit BusIO@1.15.0]
...\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3 -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Wire -I...\Documents\ARDUINO\SKETCHES\libraries\Streaming\src -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\DS1307RTC -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Time -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\SPI -I...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_SSD1306 -I...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_GFX_Library -I...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_BusIO ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\DS1307_teensy.ino.cpp -o nul
Alternatives for TimedAction.h: [TimedAction]
ResolveLibrary(TimedAction.h)
  -> candidates: [TimedAction]
...\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3 -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Wire -I...\Documents\ARDUINO\SKETCHES\libraries\Streaming\src -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\DS1307RTC -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Time -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\SPI -I...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_SSD1306 -I...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_GFX_Library -I...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_BusIO -I...\Documents\ARDUINO\SKETCHES\libraries\TimedAction ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\DS1307_teensy.ino.cpp -o nul
Using cached library dependencies for file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\AA.cpp
Using cached library dependencies for file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\Cels.cpp
Alternatives for DallasTemperature.h: [DallasTemperature@3.9.0]
ResolveLibrary(DallasTemperature.h)
  -> candidates: [DallasTemperature@3.9.0]
Alternatives for OneWire.h: [OneWire@2.3.8]
ResolveLibrary(OneWire.h)
  -> candidates: [OneWire@2.3.8]
Using cached library dependencies for file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\EEP.cpp
Using cached library dependencies for file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\OLED.cpp
Using cached library dependencies for file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\RTC.cpp
Using cached library dependencies for file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\XMSC.cpp
Using cached library dependencies for file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\ZZ.cpp
Using cached library dependencies for file: ...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Wire\Wire.cpp
Using cached library dependencies for file: ...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Wire\WireIMXRT.cpp
Using cached library dependencies for file: ...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Wire\WireKinetis.cpp
Using cached library dependencies for file: ...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Wire\utility\twi.c
Using cached library dependencies for file: ...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\DS1307RTC\DS1307RTC.cpp
Using cached library dependencies for file: ...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Time\DateStrings.cpp
Using cached library dependencies for file: ...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Time\Time.cpp
Using cached library dependencies for file: ...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\SPI\SPI.cpp
Using cached library dependencies for file: ...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_SSD1306\Adafruit_SSD1306.cpp
Using cached library dependencies for file: ...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp
Using cached library dependencies for file: ...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_GFX_Library\Adafruit_GrayOLED.cpp
Using cached library dependencies for file: ...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_GFX_Library\Adafruit_SPITFT.cpp
Using cached library dependencies for file: ...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_GFX_Library\glcdfont.c
Using cached library dependencies for file: ...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_BusIO\Adafruit_BusIO_Register.cpp
Using cached library dependencies for file: ...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_BusIO\Adafruit_I2CDevice.cpp
Using cached library dependencies for file: ...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_BusIO\Adafruit_SPIDevice.cpp
Using cached library dependencies for file: ...\Documents\ARDUINO\SKETCHES\libraries\TimedAction\TimedAction.cpp
Using cached library dependencies for file: ...\Documents\ARDUINO\SKETCHES\libraries\DallasTemperature\DallasTemperature.cpp
Using cached library dependencies for file: ...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\OneWire\OneWire.cpp
Generating function prototypes...
...\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\cores\teensy3 -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Wire -I...\Documents\ARDUINO\SKETCHES\libraries\Streaming\src -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\DS1307RTC -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Time -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\SPI -I...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_SSD1306 -I...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_GFX_Library -I...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_BusIO -I...\Documents\ARDUINO\SKETCHES\libraries\TimedAction -I...\Documents\ARDUINO\SKETCHES\libraries\DallasTemperature -I...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\OneWire ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\DS1307_teensy.ino.cpp -o ...\AppData\Local\Temp\883071840\sketch_merged.cpp
...\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives ...\AppData\Local\Temp\883071840\sketch_merged.cpp
Compiling sketch...
"...\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-tools\\1.59.0/precompile_helper" "...\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.59.0/cores/teensy3" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF" "...\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-g++" -x c++-header -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -MMD -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-I...\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.59.0/cores/teensy3" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF/pch/Arduino.h" -o "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF/pch/Arduino.h.gch"
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\pch\Arduino.h.gch
"...\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-g++" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -MMD -fno-exceptions -fpermissive -felide-constructors -std=gnu++17 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK64FX512__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY35 -DF_CPU=120000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-I...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF/pch" "-I...\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.59.0\\cores\\teensy3" "-I...\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.59.0\\libraries\\Wire" "-I...\\Documents\\ARDUINO\\SKETCHES\\libraries\\Streaming\\src" "-I...\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.59.0\\libraries\\DS1307RTC" "-I...\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.59.0\\libraries\\Time" "-I...\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.59.0\\libraries\\SPI" "-I...\\Documents\\ARDUINO\\SKETCHES\\libraries\\Adafruit_SSD1306" "-I...\\Documents\\ARDUINO\\SKETCHES\\libraries\\Adafruit_GFX_Library" "-I...\\Documents\\ARDUINO\\SKETCHES\\libraries\\Adafruit_BusIO" "-I...\\Documents\\ARDUINO\\SKETCHES\\libraries\\TimedAction" "-I...\\Documents\\ARDUINO\\SKETCHES\\libraries\\DallasTemperature" "-I...\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.59.0\\libraries\\OneWire" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\sketch\\DS1307_teensy.ino.cpp" -o "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\sketch\\DS1307_teensy.ino.cpp.o"
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\AA.cpp.o
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\ZZ.cpp.o
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\RTC.cpp.o
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\XMSC.cpp.o
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\Cels.cpp.o
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\OLED.cpp.o
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\sketch\EEP.cpp.o
Compiling libraries...
Compiling library "Wire"
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\Wire\Wire.cpp.o
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\Wire\WireKinetis.cpp.o
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\Wire\WireIMXRT.cpp.o
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\Wire\utility\twi.c.o
Compiling library "Streaming"
Compiling library "DS1307RTC"
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\DS1307RTC\DS1307RTC.cpp.o
Compiling library "Time"
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\Time\Time.cpp.o
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\Time\DateStrings.cpp.o
Compiling library "SPI"
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\SPI\SPI.cpp.o
Compiling library "Adafruit SSD1306"
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\Adafruit_SSD1306\Adafruit_SSD1306.cpp.o
Compiling library "Adafruit GFX Library"
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\Adafruit_GFX_Library\glcdfont.c.o
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\Adafruit_GFX_Library\Adafruit_GrayOLED.cpp.o
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\Adafruit_GFX_Library\Adafruit_SPITFT.cpp.o
Compiling library "Adafruit BusIO"
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\Adafruit_BusIO\Adafruit_SPIDevice.cpp.o
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\Adafruit_BusIO\Adafruit_I2CDevice.cpp.o
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\Adafruit_BusIO\Adafruit_BusIO_Register.cpp.o
Compiling library "TimedAction"
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\TimedAction\TimedAction.cpp.o
Compiling library "DallasTemperature"
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\DallasTemperature\DallasTemperature.cpp.o
Compiling library "OneWire"
Using previously compiled file: ...\AppData\Local\Temp\arduino\sketches\1ACF9A8175FA4F3CB65410E653CA53BF\libraries\OneWire\OneWire.cpp.o
Compiling core...
Using precompiled core: ...\AppData\Local\Temp\arduino\cores\teensy_avr_teensy35_usb_serial,speed_120,opt_o2std,keys_en-us_41b54cc6e6c8f982b01e804531a05140\core.a
Linking everything together...
"...\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-gcc" -O2 -Wl,--gc-sections,--relax,--defsym=__rtc_localtime=1712389883 "-T...\\AppData\\Local\\Arduino15\\packages\\teensy\\hardware\\avr\\1.59.0\\cores\\teensy3/mk64fx512.ld" -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -o "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF/DS1307_teensy.ino.elf" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\sketch\\AA.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\sketch\\Cels.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\sketch\\DS1307_teensy.ino.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\sketch\\EEP.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\sketch\\OLED.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\sketch\\RTC.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\sketch\\XMSC.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\sketch\\ZZ.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\Wire\\Wire.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\Wire\\WireIMXRT.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\Wire\\WireKinetis.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\Wire\\utility\\twi.c.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\DS1307RTC\\DS1307RTC.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\Time\\DateStrings.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\Time\\Time.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\SPI\\SPI.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\Adafruit_SSD1306\\Adafruit_SSD1306.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\Adafruit_GFX_Library\\Adafruit_GFX.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\Adafruit_GFX_Library\\Adafruit_GrayOLED.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\Adafruit_GFX_Library\\Adafruit_SPITFT.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\Adafruit_GFX_Library\\glcdfont.c.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\Adafruit_BusIO\\Adafruit_BusIO_Register.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\Adafruit_BusIO\\Adafruit_I2CDevice.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\Adafruit_BusIO\\Adafruit_SPIDevice.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\TimedAction\\TimedAction.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\DallasTemperature\\DallasTemperature.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF\\libraries\\OneWire\\OneWire.cpp.o" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF/..\\..\\cores\\teensy_avr_teensy35_usb_serial,speed_120,opt_o2std,keys_en-us_41b54cc6e6c8f982b01e804531a05140\\core.a" "-L...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF" -larm_cortexM4lf_math -lm -lstdc++
"...\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF/DS1307_teensy.ino.elf" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF/DS1307_teensy.ino.eep"
"...\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-objcopy" -O ihex -R .eeprom "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF/DS1307_teensy.ino.elf" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF/DS1307_teensy.ino.hex"
"...\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-tools\\1.59.0/teensy_secure" encrypthex TEENSY35 "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF/DS1307_teensy.ino.hex"
This board does not support code encryption
"...\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-tools\\1.59.0/teensy_post_compile" -file=DS1307_teensy.ino "-path=...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF" "-tools=...\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-tools\\1.59.0/" -board=TEENSY35
"...\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-tools\\1.59.0/stdout_redirect" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF/DS1307_teensy.ino.sym" "...\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-objdump" -t -C "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF/DS1307_teensy.ino.elf"
"...\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-tools\\1.59.0/teensy_size" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF/DS1307_teensy.ino.elf"
"...\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-tools\\1.59.0/stdout_redirect" "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF/DS1307_teensy.ino.lst" "...\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-objdump" -d -S -C "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF/DS1307_teensy.ino.elf"

Using library Wire at version 1.0 in folder: ...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Wire
Using library Streaming at version 6.1.1 in folder: ...\Documents\ARDUINO\SKETCHES\libraries\Streaming
Using library DS1307RTC at version 1.4.1 in folder: ...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\DS1307RTC
Using library Time at version 1.6.1 in folder: ...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\Time
Using library SPI at version 1.0 in folder: ...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\SPI
Using library Adafruit SSD1306 at version 2.5.9 in folder: ...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_SSD1306
Using library Adafruit GFX Library at version 1.11.9 in folder: ...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_GFX_Library
Using library Adafruit BusIO at version 1.15.0 in folder: ...\Documents\ARDUINO\SKETCHES\libraries\Adafruit_BusIO
Using library TimedAction in folder: ...\Documents\ARDUINO\SKETCHES\libraries\TimedAction (legacy)
Using library DallasTemperature at version 3.9.0 in folder: ...\Documents\ARDUINO\SKETCHES\libraries\DallasTemperature
Using library OneWire at version 2.3.8 in folder: ...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0\libraries\OneWire
"...\\AppData\\Local\\Arduino15\\packages\\teensy\\tools\\teensy-compile\\11.3.1/arm/bin/arm-none-eabi-size" -A "...\\AppData\\Local\\Temp\\arduino\\sketches\\1ACF9A8175FA4F3CB65410E653CA53BF/DS1307_teensy.ino.elf"
Sketch uses 38628 bytes (7%) of program storage space. Maximum is 524288 bytes.
Global variables use 5504 bytes (2%) of dynamic memory, leaving 256632 bytes for local variables. Maximum is 262136 bytes.
 
now you've got my attention.

As mentioned, for "warning: control reaches end of non-void function" I think it means I have missed a semi-colon somewhere. but I can't find it. Any suggestions for resolving aprpeciated.
'byte RTC_WriteByte(int, byte)' means the function should be returning a byte value.
There is either no return statement before the end of the function, or there is only "return;" with no value, or the function definition should be changed to not return any value (void). We can't tell because you haven't posted the code for it.
 
now you've got my attention.

As mentioned, for "warning: control reaches end of non-void function" I think it means I have missed a semi-colon somewhere. but I can't find it. Any suggestions for resolving aprpeciated.

Here's a (sanitised) verbose compile from a few days ago. Not sure what I'm looking for?
In the IDE do a Ctrl+T that will do a uniform formatting showing how the compiler might be reading the code.

If all paths are expected to have a return then they should be apparent, if the formatting BREAKS in readability then a semicolon, brace, paren or other text element is out of place/missing.
 
'byte RTC_WriteByte(int, byte)' means the function should be returning a byte value.
There is either no return statement before the end of the function, or there is only "return;" with no value, or the function definition should be changed to not return any value (void). We can't tell because you haven't posted the code for it.
OK here's the relevant routine (AFAIK):
Code:
byte RTC_WriteByte(int valAddr, byte bval) {
  if (valAddr >= RAM_ADDR && valAddr <= TOP_ADDR) {  // protect RTC registers 0 - 7
    Wire.beginTransmission(RTC_I2C_ADDR);
    Wire.write(valAddr);
    Wire.write(bval);
    byte busStatus = Wire.endTransmission();
    return busStatus;
  }
}

In this case ctrl-T didn't seem to have any effect.
Happy to post the whole sketch if need be. (warning: my formatting preferences will offend many!)
 
So it's returning a value when the "if" statement is true. But when it's false, all that code gets skipped and the function ends without returning anything. It needs to return something in both cases.
 
One step forward, two steps back ...
With this code:
Code:
byte RTC_WriteByte(int valAddr, byte bval){
  if (valAddr >= RAM_ADDR && valAddr <= TOP_ADDR){     // protect RTC registers 0 - 7
    Wire.beginTransmission(RTC_I2C_ADDR);
    Wire.write(valAddr);
    Wire.write(bval);
    byte busStatus = Wire.endTransmission();
    return busStatus;
    }
  else {
    return 0x04;                                      // other error
  }
}

Or this even code (I can do without busStatus):
Code:
void RTC_WriteByte(int valAddr, byte bval){
  if(valAddr >= RAM_ADDR && valAddr <= TOP_ADDR){     // protect RTC registers 0 - 7
    Wire.beginTransmission(RTC_I2C_ADDR);
    Wire.write(valAddr);
    Wire.write(bval);
    Wire.endTransmission();
  }
}

this nasty looking error is revealed instead (In both cases):
Code:
internal error in mingw32_gt_pch_use_address, at config/i386/host-mingw32.c:192: MapViewOfFileEx: Attempt to access invalid address.

exit status 1

Compilation error: exit status 1

I suspect this error isn't caused by RTC_WriteByte() but I've got no idea what it means.

Curiously I am getting exactly the same nasty error in my EEPROMmaster sketch (and it shares code with EEP.cpp/.h tabs in RTCmaster)
It was compiling a few weeks back for a non-teensy MCU, but now also gets that nasty error when I compile for teensy. WTF?
 
Last edited:
Many thanks @luni, internal error fixed.
Curiously internal the error did not occur when i compiled same sketch for R4 WiFi.

Back to the the original "control reaches end of non-void function" warning
If I did want to use the busStatus return, is this the right way to resolve the warning:

Code:
byte RTC_WriteByte(int valAddr, byte bval){
  if (valAddr >= RAM_ADDR && valAddr <= TOP_ADDR){     // protect RTC registers 0 - 7
    Wire.beginTransmission(RTC_I2C_ADDR);
    Wire.write(valAddr);
    Wire.write(bval);
    byte busStatus = Wire.endTransmission();
    return busStatus;
    }
  else {
    return 0x04;                                      // other error
  }
}

I choose 4 based on this list of returns for Wire.endTransmission():
busStatus returned values.JPG

but maybe I should choose a code outside 0 - 5?
 
perhaps this:
Code:
byte RTC_WriteByte(int valAddr, byte bval){
  byte busStatus = 0x04;                               // other error
  if (valAddr >= RAM_ADDR && valAddr <= TOP_ADDR){     // protect RTC registers 0 - 7
    Wire.beginTransmission(RTC_I2C_ADDR);
    Wire.write(valAddr);
    Wire.write(bval);
    busStatus = Wire.endTransmission();
  }
  return busStatus;
}
 
If you have a C++ rule which forbids multiple "return" inside a function, then the last code is okay. Otherwise the previous just prevents a double assignments to busStatus for a better machine code (supposedly the compiler is not smart enough to do that optimization).
 
Back
Top