PDA

View Full Version : Compiler warning in usb_serial.c on teensy3



froeber
05-27-2013, 12:14 PM
Paul, When I compile code for my teensy3 I get a warning in usb_serial.c. This isn't a new warning but persists even in the latest 1.14 rc3 version. I think it's a simple case that you need to add an include of string.h in that file. The compile statement and warning is:

C:\arduino\arduino-1.0.5\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=48000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX128__ -DTIME_T=1369576988 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -IC:\arduino\arduino-1.0.5\hardware\teensy\cores\teensy3 C:\arduino\arduino-1.0.5\hardware\teensy\cores\teensy3\usb_serial.c -o C:\froeber\Projects\Kuji_lighter\SmartLighter\Ardu ino\Build\usb_serial.c.o
C:\arduino\arduino-1.0.5\hardware\teensy\cores\teensy3\usb_serial.c: In function 'usb_serial_read':
C:\arduino\arduino-1.0.5\hardware\teensy\cores\teensy3\usb_serial.c:8 1:3: warning: implicit declaration of function 'memcpy' [-Wimplicit-function-declaration]
C:\arduino\arduino-1.0.5\hardware\teensy\cores\teensy3\usb_serial.c:8 1:3: warning: incompatible implicit declaration of built-in function 'memcpy' [enabled by default]

MichaelMeissner
05-27-2013, 07:58 PM
Paul, When I compile code for my teensy3 I get a warning in usb_serial.c. This isn't a new warning but persists even in the latest 1.14 rc3 version. I think it's a simple case that you need to add an include of string.h in that file. The compile statement and warning is:

C:\arduino\arduino-1.0.5\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=48000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX128__ -DTIME_T=1369576988 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -IC:\arduino\arduino-1.0.5\hardware\teensy\cores\teensy3 C:\arduino\arduino-1.0.5\hardware\teensy\cores\teensy3\usb_serial.c -o C:\froeber\Projects\Kuji_lighter\SmartLighter\Ardu ino\Build\usb_serial.c.o
C:\arduino\arduino-1.0.5\hardware\teensy\cores\teensy3\usb_serial.c: In function 'usb_serial_read':
C:\arduino\arduino-1.0.5\hardware\teensy\cores\teensy3\usb_serial.c:8 1:3: warning: implicit declaration of function 'memcpy' [-Wimplicit-function-declaration]
C:\arduino\arduino-1.0.5\hardware\teensy\cores\teensy3\usb_serial.c:8 1:3: warning: incompatible implicit declaration of built-in function 'memcpy' [enabled by default]

Yes, that is what the warning means, and including string.h is one way to get memcpy declared properly (or include something else that ultimately includes string.h).

PaulStoffregen
05-27-2013, 08:01 PM
Opps. This warning may be annoying, but it's harmless.

I'll put this on the list for 1.15, since I just released 1.14 this morning.

froeber
05-28-2013, 12:47 AM
Opps. This warning may be annoying, but it's harmless.

I'll put this on the list for 1.15, since I just released 1.14 this morning.

Hi folks, So, I'm new to using Arduino platform and Teensy 3.0 HW but not to SW. I've actually been doing embedded SW for over 30 years and written lots of SW and fixed a lot of commercial SW products by working with the vendors. I'm not sure what the best approach is for reporting issues that pop up with this Teensy SW so I took a stab at posting to bug reports. I did look at the FAQs and didn't see anything on bug reporting etiquette. So I'm just wondering if posting a report the way I did is the right way, ie indicating the error I saw and what the necessary fix was. I'm real impressed with this Teensy stuff and how it seems Paul stays on top of things so I figured he would see the post and know it was trivially easy to fix by adding the missing include. And, as I suspected, he did ;-).

I also saw that Michael (who also seems to know his stuff) posted that there was nothing to worry about with the warning. I'm just wondering if I should have mentioned that in my original post to keep other users from worrying there was some problem that was going to bite them when there wasn't in this case.

I'm looking forward to working with this Teensy 3.0 platform as it really kicks ass relative to the standard AVR based ones. Fred

PaulStoffregen
06-06-2013, 09:17 PM
Opps. This warning may be annoying, but it's harmless.


Fixed in 1.15-rc1.

Some new (and likely harmless) warnings may be present in the new math library stuff. It'll get ironed out eventually...