OpenNuvoton / M031BSP

BSP for M031 Series MCU
Apache License 2.0
15 stars 16 forks source link

Cannot compile anymore using C Compiler V6 #18

Open jeromeDms opened 1 year ago

jeromeDms commented 1 year ago

Hi I updated to the latest Nuvoton Keil ARM compiler V5.38, and my project no longer compile. The issue is in retarget.c from Nuvoton BSP.

compiling retarget.c...
../../../../../nuvoton/M031/Library/StdDriver/src/retarget.c(50): error: tentative definition has type 'FILE' (aka 'struct __FILE') that is never completed
FILE __stdout;
     ^
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stdio.h(108): note: forward declaration of 'struct __FILE'
typedef struct __FILE FILE;
               ^
../../../../../nuvoton/M031/Library/StdDriver/src/retarget.c(51): error: tentative definition has type 'FILE' (aka 'struct __FILE') that is never completed
FILE __stdin;
     ^
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stdio.h(108): note: forward declaration of 'struct __FILE'
typedef struct __FILE FILE;
               ^
2 errors generated.

Any idea how to solve this issue ? Thanks

kchuang1 commented 1 year ago

Hi,

If you are urgent, you can try to replace these files to your BSP source code but it may affect other sample to build fail.

Another way is to install another Keil4 on your environment and build the your proejct with Keil4.

M031_Keil6.zip