LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-04-2006, 02:42 AM   #1
hedpe
Member
 
Registered: Jan 2005
Location: Boston, MA
Distribution: Debian
Posts: 380

Rep: Reputation: 30
C code: error: incompatible types in assignment


Hey,

I am trying to fix an incompatible types in assignment error, and I can't quite figure it out.

Here is where the error comes from:
Code:
curr_cap_header->markings[curr_marking] = (u8) 0;
Here is the related code
Code:
void create_capability_header(char *buffer, unsigned short buffer_size);

struct iphdr *ip_header;
pubkey_token *token_key;
bcap_token_hdr *token_header;
secflow_capability *curr_cap_header;

struct udphdr *udp_header;

char *currpos;

void create_capability_header(char *buffer, unsigned short buffer_size) {
	int curr_marking;
	curr_cap_header = (secflow_capability *) currpos;
	curr_cap_header->id = 1;
	curr_cap_header->prioclass = 0;
	curr_cap_header->cur_router = 1;

	for(curr_marking=0; curr_marking < MAXPATHLEN; curr_marking++) {
		curr_cap_header->markings[curr_marking] = (u8) 0;
	}

	currpos = (char *)curr_cap_header + sizeof(secflow_capability);
}
Code:
typedef struct t_secflow_marking{
  u8 marking;
} secflow_marking;

typedef struct t_secflow_capability{
  u32 id;
  u16 prioclass;
  u16 cur_router;
  secflow_marking markings[MAXPATHLEN];
}secflow_capability;
I'd appreciate any help... thanks!

- George
 
Old 12-04-2006, 06:58 AM   #2
vkmgeek
Member
 
Registered: Feb 2006
Location: Ahmedabad
Distribution: rhel5
Posts: 185
Blog Entries: 2

Rep: Reputation: 31
I dont see anything wrong here.
Just give me how u8 is type defined?
 
Old 12-04-2006, 10:30 AM   #3
rstewart
Member
 
Registered: Feb 2005
Location: Sunnyvale, CA
Distribution: Ubuntu
Posts: 205

Rep: Reputation: 38
Quote:
curr_cap_header->markings[curr_marking] = (u8) 0;
Shouldn't your code be:
Code:
curr_cap_header->markings[curr_marking].marking = (u8) 0;
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ndiswrapper error: Incompatible architecture bmccorm2 Linux - Wireless Networking 1 08-28-2006 01:53 PM
Error: invalid lvalue in assignment xxrsc Linux - Software 1 08-17-2006 01:43 PM
c++ incompatible types in assignment of `char*' f76 Programming 1 07-29-2005 01:42 PM
scsi error or hardware incompatible? Freaky Dave Linux - Hardware 4 07-05-2004 11:29 PM
Getting an incompatible pointer type error... JStew Programming 4 03-06-2003 05:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration