bug in compiler or am i doing something wrong?

Discussion and support of the compiler from ImageCraft for the M8C.

Moderator: richard@imagecraft.com

bug in compiler or am i doing something wrong?

Postby zorglub » Tue Jul 20, 2010 2:45 pm

i created a typedef enum in a header file:
def.h
Code: Select all
#ifndef DEF_H
#define DEF_H

typedef enum {
   BEAT_EVEN,
   BEAT_ODD
} beat_t;

#endif

and use it in function declaration in another header file:
module.h
Code: Select all
#ifndef MODULE_H
#define MODULE_H

#include "def.h"

void do_something(beat_t beat);

#endif

and i get the following error when compiling with imagecraft:
!E C:\...\module.h(6): syntax error; found `beat' expecting `)'
!E C:\...\module.h(6): skipping `beat'
!E C:\...\module.h(6): extraneous old-style parameter list

any suggestion?

cheers,
zorglub
zorglub
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Wed Aug 27, 2008 9:55 am

Re: bug in compiler or am i doing something wrong?

Postby richard@imagecraft.com » Tue Jul 20, 2010 3:20 pm

Almost certainly a user error. May be missing some other syntactic element in a file in between etc. Embedded ^Z could also be a problem sometimes.

If you look at the output directory, there should be a C preprocessed file <file>.i, this is after C preprocessing, so it should be clear where the problem is. If you have problem figuring it out, send me the file to richard
@imagecraft.com
richard@imagecraft.com
Cheese Wheel
Cheese Wheel
 
Posts: 167
Joined: Mon Apr 05, 2004 10:33 pm

Re: bug in compiler or am i doing something wrong?

Postby zorglub » Tue Jul 20, 2010 5:24 pm

my bad :oops: i messed up with #include
cheers,
zorglub
zorglub
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 18
Joined: Wed Aug 27, 2008 9:55 am

Re: bug in compiler or am i doing something wrong?

Postby richard@imagecraft.com » Tue Jul 20, 2010 5:32 pm

Not a problem. People usually blame the compilers first :-) (hmmm that should be a :-( )

Remember, ICCM8C is not a brand new compiler written by a new college grad, but based on technology we started using since 1994 :-) so chances of it messing up on simple things are slim. Unfortunately, all programs have bugs of course, so there are occasionally eggs on our faces as well.
richard@imagecraft.com
Cheese Wheel
Cheese Wheel
 
Posts: 167
Joined: Mon Apr 05, 2004 10:33 pm


Return to “%s” ImageCraft ICCv7 for M8C Compiler

Who is online

Users browsing this forum: No registered users and 1 guest