Jump to content

Erroneous Warning '->' Is Used With A Non-pointer (use '.' Instead)


Recommended Posts

Hi Pavel,

 

It's me again I am afraid :lol:

 

boostc v7.01

PIC18F2525

 

warning: '->' is used with a non-pointer (use '.' instead)

If I avoid using the pTestStruct typedef it compiles OK.

 

 

//***********************

#include <system.h>

 

typedef struct {

char kw[5];

} TTestStruct;

typedef TTestStruct* pTestStruct;

 

typedef struct {

pTestStruct k; //k is the 128 bit key.

} TParams;

 

TParams XXP;

 

void main(void)

{

char p;

 

p = XXP.k->kw[0]; //Warning here

 

while(1);

}

 

//***********************

Link to post
Share on other sites

Hi Andrew,

 

No warnings for me using PIC18F4580.

 

void main()

{
char p;

p = XXP.k->kw[0]; //Warning here
05CE  5020		  MOVF gbl_XXP+D'1', W
05D0  6EEA		  MOVWF FSR0H
05D2  501F		  MOVF gbl_XXP, W
05D4  6EE9		  MOVWF FSR0L
05D6  50EF		  MOVF INDF0, W
05D8  6E25		  MOVWF main_1_p

 

Cheers

 

Reynard

 

I spoke too soon. Turn on All Warnings and you get the warning. Doh!

Edited by Reynard
Link to post
Share on other sites
  • 2 weeks later...

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