LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-21-2009, 10:21 PM   #1
snorlaxgb
LQ Newbie
 
Registered: Aug 2009
Posts: 5

Rep: Reputation: 0
Help fixing errors from code accepted by older GCC


Hello,

I need help in correcting that compiles in older versions of GCC.

Here are the errors I am getting:


atomic/alpha/atomic.h:47: error: expected ',' or '...' before '*' token
atomic/alpha/atomic.h:47: warning: ISO C++ forbids declaration of 'u_int8_t' with no type
atomic/alpha/atomic.h:48: error: expected ',' or '...' before '*' token
atomic/alpha/atomic.h:48: warning: ISO C++ forbids declaration of 'u_int8_t' with no type
atomic/alpha/atomic.h:49: error: expected ',' or '...' before '*' token
atomic/alpha/atomic.h:49: warning: ISO C++ forbids declaration of 'u_int8_t' with no type
atomic/alpha/atomic.h:50: error: expected ',' or '...' before '*' token
atomic/alpha/atomic.h:50: warning: ISO C++ forbids declaration of 'u_int8_t' with no type
atomic/alpha/atomic.h:52: error: expected ',' or '...' before '*' token
atomic/alpha/atomic.h:52: warning: ISO C++ forbids declaration of 'u_int16_t' with no type
atomic/alpha/atomic.h:53: error: expected ',' or '...' before '*' token
atomic/alpha/atomic.h:53: warning: ISO C++ forbids declaration of 'u_int16_t' with no type
atomic/alpha/atomic.h:54: error: expected ',' or '...' before '*' token
atomic/alpha/atomic.h:54: warning: ISO C++ forbids declaration of 'u_int16_t' with no type
atomic/alpha/atomic.h:55: error: expected ',' or '...' before '*' token
atomic/alpha/atomic.h:55: warning: ISO C++ forbids declaration of 'u_int16_t' with no type
atomic/alpha/atomic.h:57: error: expected ',' or '...' before '*' token
atomic/alpha/atomic.h:57: warning: ISO C++ forbids declaration of 'u_int32_t' with no type


Here is the following snippet:



void atomic_set_8(volatile u_int8_t *, u_int8_t);
void atomic_clear_8(volatile u_int8_t *, u_int8_t);
void atomic_add_8(volatile u_int8_t *, u_int8_t);
void atomic_subtract_8(volatile u_int8_t *, u_int8_t);

void atomic_set_16(volatile u_int16_t *, u_int16_t);
void atomic_clear_16(volatile u_int16_t *, u_int16_t);
void atomic_add_16(volatile u_int16_t *, u_int16_t);
void atomic_subtract_16(volatile u_int16_t *, u_int16_t);


Thanks in Advance!
 
Old 08-21-2009, 10:29 PM   #2
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
I think you just need to lose the underscore between u and int8. Here's the man page

http://linux.die.net/man/3/uint8_t
 
Old 08-21-2009, 10:32 PM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

<stdint.h> should define "uint8_t", the new(er) standard definition for "unsigned byte". I'm not sure exactly who uses (or ever used) "u_int8_t", but going forward, you definitely want "uint8_t.

And clearly, your problem is that "u_int8_t" doesn't happen to be defined in your (new) environment.

SUGGESTION:
Create a local "typedefs.h" for instances like this (the odds are pretty good you'll probably encounter others):

http://markmail.org/message/srd36wevsvcwzdhi

'Hope that helps .. PSM
 
Old 08-21-2009, 10:34 PM   #4
snorlaxgb
LQ Newbie
 
Registered: Aug 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Wow...thank you so much. Works now!

Last edited by snorlaxgb; 08-21-2009 at 10:36 PM.
 
Old 08-22-2009, 01:46 AM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
you might also want to have a look at the gcc 4.3 and 4.4 porting guide pages
http://gcc.gnu.org/gcc-4.3/porting_to.html
http://gcc.gnu.org/gcc-4.4/porting_to.html
 
Old 08-22-2009, 11:22 PM   #6
snorlaxgb
LQ Newbie
 
Registered: Aug 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Thank you, very useful!!
 
  


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
how to fixing file system errors in solaris?? a.toraby Solaris / OpenSolaris 6 05-26-2007 11:48 PM
slowly fixing all the errors, please help :-\ y0shi Slackware 13 10-24-2004 08:25 PM
fixing kernel errors entropyguy Linux - Newbie 0 10-13-2004 06:01 PM
fixing dvd-r errors festriaqua Linux - Software 0 08-11-2004 08:45 PM
Fixing HD errors in Knoppix KungFuHamster Linux - General 7 05-01-2003 05:13 PM

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

All times are GMT -5. The time now is 02:32 AM.

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