Jump to content
JorgeF

Dot (.) Operator, Bits Versus Struct Or Union

Recommended Posts

Hi

 

I'm not exactly sure if it is a bug or a feature but the BoostC compiler report an "unexpected '.' operator" when its used to access a bit in the same expression with the '.' operator for accesing a struct or union field.

 

Sample:

 

.
.
// Type definition
typedef union
		{
		BYTE	Buffer[i2C_EXEC_BUFLEN];
		struct
			{
			BYTE	State;
			BYTE	Adc_Res;
			BYTE	Seconds;
			BYTE	Comm_Status;
			BYTE	Exec_04;
			BYTE	Exec_05;			// False interrupt INTCON
			BYTE	Exec_06;			// False interrupt PIR1
			BYTE	Version;
			} Fields;
		} EXEC_DATA;
.
.
.
// Variable declaration
EXEC_DATA  Executive_Data;
.
.
.
// Statement
Executive_Data.Fields.Comm_Status.0 = portc.7;			 // ********* ERROR ********


// ************** COMPILER MESSAGE *********************
"C:\Program Files\SourceBoost\boostc_pic16.exe" -t PIC16F886  -idx 1 -obj Debug -d _DEBUG Adc.c PKSD_JF.c Interrupt.c Globals.c Rtcc.c I2C.c Executive.c Pksi.c

BoostC Optimizing C Compiler Version 7.05 (for PIC16 architecture)
[url="http://www.sourceboost.com"]http://www.sourceboost.com[/url]
Copyright© 2004-2011 Pavel Baranov
Copyright© 2004-2011 David Hobday

Licensed to António Ferreira under Single user Pro License for 2 node(s)
Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited


Adc.c
PKSD_JF.c
<C:\Program Files\SourceBoost\include\icd3.h> @ 20: MESSAGE: "Including ICD3 declarations (icd3.h)"
<C:\Program Files\SourceBoost\include\icd3.h> @ 1230: MESSAGE: "Warning: ICD3 Reserved ROM address range:0x1F00-0x1FFF (use linker -rt option)"
Interrupt.c
Globals.c
Rtcc.c
I2C.c
Executive.c
Pksi.c

failure
Pksi.c(16:35): error: unexpected '.' operator after 'Comm_Status'
Pksi.c(16:2): error: failed to generate expression
Pksi.c(16:2): error: invalid operand 'Executive_Data.Fields.Comm_Status.0'
Pksi.c(16:38): error: failed to generate expression
Failed to locate output file 'Debug\Pksi.obj'
Done

Failed

 

 

 

Best regards

 

Jorge

Edited by JorgeF

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

×
×
  • Create New...