Hi I am new to HC08 (hence the alias)
and am trying to take over from the previous software developer.
I am working with a
MC9S08GT60 in CodeWarrior 6.3
Going through his code, I am getting the following compiler errors, when I try build this file.
Errors:
Warning : C1013: Old style declarationascii_utilities.h line 5 Error : C2801: 'IDENT' missingascii_utilities.h line 5 Error : C5002: Illegal typeascii_utilities.h line 5 Error : C1400: Missing parameter name in function headascii_utilities.h line 5 Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__ ascii_utilities.h line 5 Error : C1834: Indirection applied to non-pointerascii_utilities.h line 5 Error : Compile failed
The files Im trying to compile are simply:
ascii_utilities.c
#include "includes.h"void int2string (__uint32__ value, char *string) { __uint8__ remainder; __uint8__ offset = 9; strcpy(string, " "); do { remainder = value % 10; string[offset] = dec2char(remainder); value = value / 10; offset--; } while (value != 0); string[10] = 0; //Set to null.}char dec2char(__uint8__ value) { if ((value >= 0) && (value <=9)) return (char) (value + 0x30); else return 0;}
and
ascii_utilities.h
#ifndef _UTIL_H_ #define _UTIL_H_//Prototypesvoid int2string(UINT32, char *);char dec2char(UINT8);#endif
I've been looking at the 'HC08 Compiler Messages' help file, but Im struggling to resolve these errors.
I thought it might be the way the parameters to the functions are being declared, but no luck
help?
thanks,
Byron
Hello
I would need the actual source files in order to try it out.
Can you generate the preprocessor output and attach it here?
To generate preprocessor output click right on the file name in the .mcp file and select preprocess.
A new window will be opened. Save content of the window to a file and send it over.
CrasyCat
Hi there.
Appreciate the prompt response,
Please find the source files attached, along with the preprocess output.
I dont know if you require the MCU header file as well? I can only attach 3 files at a time. so I can send it in another message.
Im sure this is just some dumb error on my part , failing to comply with the compiler standards, but Id appreciate any light you can shed on the issue.
Cheers.
Hello
In ascii_utilities.h you are using type UINT32, which is not defined before.
Make sure to include the header file where UINT32 is defined before ascii_utilities.h.
Note: UINT8 also need to be defined.
CrasyCat
Hi
Thanks for your response.
In a more general question:
If you like at the header file:
bootloader user api.h
and have a look at the global vars and arrays, declared as 'externs'....
the header file (bootloader user api.h) is only included in includes.h if BOOTLOADER_ENABLED is defined.
1. Where should this be defined or not?
2. If it is not defined and therefore the header file is not included, the source file (bootloader user api.c) is going to give compiler errors everytime, is it not? is there a resolution?
Cheers...