[DONE] Can not compile chprintf.c

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
Post Reply
plain
Posts: 4
Joined: Thu Jan 09, 2014 11:39 am

[DONE] Can not compile chprintf.c

Post by plain »

I am trying ChibiOS for a few day. I got the demo project compiled, but when I try to compile my project with chprintf.h included, the compiler reported some errors

Code: Select all

compiling chprintf.c...
..\..\..\os\various\chprintf.h(69): warning:  #260-D: explicit type is missing ("int" assumed)
  static inline void chprintf(BaseSequentialStream *chp, const char *fmt, ...) {
..\..\..\os\various\chprintf.h(69): error:  #65: expected a ";"
  static inline void chprintf(BaseSequentialStream *chp, const char *fmt, ...) {
..\..\..\os\various\memstreams.h(63): warning:  #12-D: parsing restarts here after previous syntax error
  };
..\..\..\os\various\chprintf.c: 2 warnings, 1 error

My compiler is Keil MDK v4.73.
Can any body tell me how to solve thi problem please?
Thanks & Regards
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Can not compile chprintf.c

Post by Giovanni »

Hi,

I will try it over the weekend.

Giovanni
plain
Posts: 4
Joined: Thu Jan 09, 2014 11:39 am

Re: Can not compile chprintf.c

Post by plain »

Giovanni wrote:Hi,

I will try it over the weekend.

Giovanni


Thanks for your reply. I look forward hearing from you.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Can not compile chprintf.c

Post by Giovanni »

Hi,

It is a bug, that declaration uses a C99 keywork while the project is compiled in C90 mode.

Replace "inline" with "INLINE", the fix will be present in version 2.6.3.

Giovanni
plain
Posts: 4
Joined: Thu Jan 09, 2014 11:39 am

Re: Can not compile chprintf.c

Post by plain »

Giovanni wrote:Hi,

It is a bug, that declaration uses a C99 keywork while the project is compiled in C90 mode.

Replace "inline" with "INLINE", the fix will be present in version 2.6.3.

Giovanni


Thank you so much. I can compile it now :D
daemon
Posts: 35
Joined: Tue Oct 09, 2012 1:53 pm

Re: [DONE] Can not compile chprintf.c

Post by daemon »

Hello!

I have the same error. At first my workaround was to use __STATIC_INLINE from core_cm4.h (#include "hal.h") but now I am following Giovanni suggestion. The patch is:

Code: Select all

--- chprintf.h.old   2013-12-04 20:24:42.000000000 +0200
+++ chprintf.h   2014-01-14 14:25:06.000000000 +0200
@@ -66,7 +66,7 @@
  *
  * @api
  */
-static inline void chprintf(BaseSequentialStream *chp, const char *fmt, ...) {
+static INLINE void chprintf(BaseSequentialStream *chp, const char *fmt, ...) {
   va_list ap;
 
   va_start(ap, fmt);
Post Reply