Jump to content
Sign in to follow this  
Andrew Leiper

Problem With Null Pointer Test And 2 Other Conditions

Recommended Posts

Hi Dave,

 

SourceBoost V7.01

PIC18F2525

 

I'm not sure whether it is valid to assume that conditions are evaluated in the order they are written with SourceBoost but either way the code below generates a compiler error.

 

//////////////////////////////////

#include <system.h>

 

typedef struct {

unsigned char a;

} TTestStruct;

 

typedef TTestStruct* PTestStruct;

 

TTestStruct s1;

PTestStruct ps;

 

void main(void)

{

ps = &s1;

 

//Removing any one of the 3 conditions allows it to compile

while (

(ps) && //Error: Failed to generate expression

(ps->a >= 1) &&

(ps->a <= 10)

)

{

//

}

}

//////////////////////////////////

 

Cheers,

 

Andy Leiper

IET Ltd

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