This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

strange compiler error #18 (code definition with line break)

Hi,

I use Keil MicroVision (v. 5.11.1.0) for programming a Cortex-M4 microcontroller from TI.

After migrating my project from StellarisWare to TivaWare I get compiler errors for nearly equal line of code, which contains a line break.

For me it doesn't seem TI specific, so I post it here in the Keil forum.

Here is an example error:

compiling ustdlib.c...
..\..\TivaWareM4C\utils/ustdlib.h(55): error:  #18: expected a ")"
  extern int usnprintf(char * restrict s, size_t n, const char * restrict format,

The related source lines are these:

extern int usnprintf(char * restrict s, size_t n, const char * restrict format,
                     ...);

I'm not shure, why TI added a line break and what's the meaning of "...".
I don't want to modify this file (and others) of the TivaWare package, because this can cause a coders hell.

.

What's strange?

StellarisWare (the predecessor of TivaWare) also contains a file "ustdlib.c", which also has definitions with line breaks. But compiling this causes no error.

.

In direct comparison:

Line in "ustdlib.c" of StellarisWare:

extern int usnprintf(char *pcBuf, unsigned long ulSize, const char *pcString,
                     ...);

Line in "ustdlib.c" of TivaWare:

extern int usnprintf(char * restrict s, size_t n, const char * restrict format,
                     ...);

The same compiler error happens to other lines, which contains a line break.
Example:

extern float ustrtof(const char * restrict nptr,
                     const char ** restrict endptr);

.

Why I get such compiler errors after my migration to TivaWare?
Also before the migration I included the file "ustdlib.c" (including such wrapped lines) and had no errors.

If you need further information, just tell me.

0