Jump to content

Literal String Handling Issue


Recommended Posts

This code fails to compile correct (but stupid) C code:

 

#include <system.h>

char *tx = "0123";

void main()
{
 char test;

 test = *"0123"+1;
 test = tx[2];
 test = "0123"[3]; /* compile fails with: test.c(11): error: missing semicolon */
}

 

Bug description:

Valid C syntax rejected by compiler

 

Steps to reproduce:

Compile sample code

 

Expected behavior:

Compile without errors or warnings

 

Is the problem 100% reproducible:

Always occurs

 

IDE version: SourceBoost IDE version 6.35

Compiler: BoostC

Compiler version: 6.35

Target device: PIC16F877A

OS: Windows XPpro SP2

Edited by cac001
Link to post
Share on other sites
 test = "0123"[3]; /* compile fails with: test.c(11): error: missing semicolon */

 

BoostC parser may not handle such construction (I need to verify this on the compiler sources). Is this feature important for you?

 

Regards,

Pavel

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...
×
×
  • Create New...