Jump to content
Sign in to follow this  
thiemann

Boostc Compiler: Some Compiler Errors Missing

Recommended Posts

Bug description:

The compiler does not warn when a variable is redefined or when a variable is set to a constant that does not fit within the variable.

 

Steps to reproduce:

1.) Create a new project

2.) Add a main.c file to the project with the following code

void main()
{
    char x = -129;          // -129 is too big to fit into char
    unsigned char x = 3; // x is already defined

    char w;
    w = x;
}

3.) Compile and link the project using BoostC

4.) Notice that the code compiles fine and no warnings or errors are generated.

 

Expected behavior:

The compiler should fail to compile the code.

 

Is the problem 100% reproducible:

Yes

 

SourceBoost version: 5.6.1

Compiler: BoostC

Compiler version: 1.3 Alpha

 

OS: Windows XP

 

Comments:

MSVC++ fails to compile the code, if that is worth anything.

Share this post


Link to post
Share on other sites

Yes, its looks like it is fixed, however, a form of the extern problem is back. Note: the following should compile fine (and did in Boostc 1.3), but now doesn't:

 

extern char x;

char x;


void main()
{

}

Share this post


Link to post
Share on other sites
Has the problem that came back been fixed?

 

Yes the problem has been fixed and relevant tests added to regression. Fix will be available in the next release (or update).

 

Regards,

Pavel

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...