Jump to content
Sign in to follow this  
AudiTTR

Typedef Compilation Error With Arrays

Recommended Posts

Bug description:

I get the following error when trying to compile code that contains the following typedef syntax:

error: missing semicolon

typedef char Buffer[8];

 

Steps to reproduce:

Compile the following code:

 

#include <system.h>

void main()
{
typedef char Buffer[8];

Buffer buffer1;

buffer1[0] = 0x01;
buffer1[1] = 0x02;

}

error: missing semicolon
is reported by the compiler on the typedef statement at line #5.

 

Expected behaviour:

As per the ANSI C standard, in this example a type called Buffer should be created, which is actually an alias for an array of 8 bytes. The Buffer type can then be used to declare variables, which act in the same manner as though they were directly declared as an array of 8 bytes (see example code above).

 

Is the problem 100% reproduceable:

100% reproduceable, happens every single time.

 

IDE version: v6.40

Compiler: BoostC

Compiler version: v6.40

Target device: PIC18F4550

OS: Windows XP SP2

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...