LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 02-02-2010, 08:03 AM   #1
shawley
LQ Newbie
 
Registered: Oct 2009
Posts: 12

Rep: Reputation: 0
Question Why the expected =, ,, ;, asm or __attribute__ before typedef error?


Can you tell me why gcc on LINUX is giving me this error (works find on our SCO machine)

/us4/prw/include/vv_sys.h:797: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'typedef'


797 typedef struct node_struct /*NODE STRUCTURE */
798 {
799 struct node_struct *prev_ndp; /*previous node pointer */
800 struct node_struct *next_ndp; /*next node pointer */
801 PTR datap; /*data pointer */
802 } NODE, *NODEPTR;
 
Old 02-02-2010, 08:12 AM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
My guess is you have a problem before that, perhaps a missing } or ;.
Kevin Barry
 
Old 02-02-2010, 08:20 AM   #3
shawley
LQ Newbie
 
Registered: Oct 2009
Posts: 12

Original Poster
Rep: Reputation: 0
I did think of that. I looked (quickly), but I will look harder.
This is the identical .h used on the other machine (SCO)
with no errors which is why I wasn't too concerend about that
type of problem but I will check some more.
Thanks for the reply.
 
Old 02-02-2010, 08:59 AM   #4
carbonfiber
Member
 
Registered: Sep 2009
Location: Sparta
Posts: 237

Rep: Reputation: 46
Well, perhaps sharing some of the code preceeding the typedef might help us help you.
 
Old 02-02-2010, 10:16 AM   #5
shawley
LQ Newbie
 
Registered: Oct 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Here is a larger look for what it is worth. Didn't want to print the whole thing.

.
.
.
/* Development only error codes */
#define BADWNSTRUC 17 /*Corrupted WINDOW structure */
#define BADMFSTRUC 18 /*Corrupted MFILE structure */
#define BADSCRSTRUC 19 /*Corrupted SCR structure */
#define BADCLSTRUC 20 /*Corrupted CLIST structure */
#define BADFMSTRUC 21 /*Corrupted FORM structure */
#define BADMNSTRUC 22 /*Corrupted MENU structure */
#define BADITEMSTRUC 23 /*Corrupted item structure */
#define BADBGSTRUC 24 /*Corrupted background structure */
#define WNBORDERLESS 25 /*Invalid op. on borderless window */
#define WNISUP 26 /*Window is already up */
#define WNNOTUP 27 /*Window is not up */
#define WNNOTDIRECT 28 /*Window is not direct display */
#define WNNOTPOPUP 29 /*Window is not a pop-up */
#define WNTOOBIG 30 /*Window too big for the buffer */
#define MFROWNEG 31 /*Memory file row is negative */
#define MFROWTOOBIG 32 /*Memory file row number is too large */
#define STRTOOLONG 33 /*String too long */
#define FULLTABLE 34 /*Function table full */
#define NOMFILEPTR 35 /*No MFILE pointer installed in window*/
#define NOKTP 36 /*Keytable pointer cannot be a NULLP */
#define NOWNIMAGE 37 /*No window image saved */
#define NOSUCHFLD 38 /*Field does not exist */
#define NOSUCHITEM 39 /*No item with this number on form */
#define BADPTR 40 /*NULLP is not allowed */
#define BADPARM 41 /*Bad parameter value */
#define BADWNCOORD 42 /*Bad window coordinates */
#define BADLINECOORD 43 /*Bad line coordinates */
#define BADBOXCOORD 44 /*Bad box coordinates */
#define BADTEXTCOORD 45 /*Bad text coordinates */
#define BADFLDCOORD 46 /*Bad field coordinates */
#define BADPRPTCOORD 47 /*Bad prompt coordinates */
#define BADSRCOORD 48 /*Bad scrollable region coordinates */
#define BADMEMOCOORD 49 /*Bad memo coordinates */
#define BADMENUCOORD 50 /*Bad menu coordinates */
#define BADDATE 51 /*Invalid date string */
#define BADTIME 52 /*Invalid time string */
#define BADFORMAT 53 /*Invalid date/time format string */
#define BADCLITEM 54 /*No item with this number in list */
#define BADFMTYPE 55 /*Wrong type of form to add field to */
#define BADPIC 56 /*Bad picture */
#define BADROW 57 /*Bad row number */
#define BADCOL 58 /*Bad data column number */
#define FMISUP 59 /*Form is on screen */
#define FMNOTUP 60 /*Form is not on screen */
#define FMISREADY 61 /*Cannot add fields to ready forms */
#define FMEMPTY 62 /*No active items on the form */
#define NOTDFIELD 63 /*Data field expected */
#define NOTMEMOFLD 64 /*Memo field expected */
#define NOPICSYMFUNC 65 /*No picture symbol function */
#define BADFLDTYPE 66 /*Illegal operation for this fld type */
#define NOSCROLLBAR 67 /*This window has no scroll bars */
#define NORGSETFUNC 68 /*No range set function */
#define FLDDISABLED 69 /*Field type has not been enabled */
#define SROWNOTVIS 70 /*Scrollable row not visible */
#define DL_ACCERR 71 /*Invalid access code */
#define DL_LOCKERR 72 /*Lock_status parameter was not LOCK */
#define DR_KEYERR 73 /*Directory record key was a null */
#define FL_EOFILE 74 /*End of file has been reached */
#define FL_PRVLOCKED 75 /*File locked by a previous user */
#define FL_NFOUND 76 /*File not found */
#define DL_RCNTYPE 77 /*Record was not the requested type */
#define DR_PRVLOCKED 78 /*Dir record locked by previous user */
#define DR_CURLOCKED 79 /*Dir record locked by current user */
#define DR_NFOUND 80 /*Dir record not found */
#define DR_NLOCKED 81 /*Dir record not locked */
#define DL_EORECS 82 /*End of directory records has been */
#define DL_DATAERR 83 /*Data len greater than max allowed */
#define FL_BADPATH 84 /*Specified drive/path nonexistent */
#define FL_NPERM 85 /*User doesn't have req. permissions */
#define NOSUCHSR 86 /*Scrollable region does not exist */
#define NOSUCHFUNC 87 /*Function name not in function list */
#define FUNCNOTRES 88 /*Functions have not been resolved */
#define DATANOTRES 89 /*Data pointers have not been resolved*/
#define CLISTNOTRES 90 /*Choice lists have not been resolved */
#define FMISVVD 91 /*Cannot make VVD form READY */
#define LIBNOTFOUND 92 /*Library name not found */
#define FMNOTRES 93 /*Form not resolved */
#define FMNOTFOUND 94 /*Form not found in list */
#define DL_RECFORMAT 95 /*Bad VMS record format */

/******************************************************************************/
/* System informational message definitions */
/******************************************************************************/

/* Quantity of VCS informational messages */
#define VCSINFOQ 24

/*reserve 0 for no message */
#define INITMEMLACK 1 /*Insufficient memory to initialize */
#define ERR_OVVTC 2 /*Error opening VVTERMCAP file */
#define TERMNOTFOUND 3 /*No terminal description found */
#define TERMTOOLONG 4 /*Terminal description too long */
#define NOTERM 5 /*Unable to determine terminal type */
#define NODUMBTERM 6 /*VV cannot use a dumb terminal */
#define BADTERMDEF 7 /*Bad terminal description */
#define NOCHANNEL 8 /*Unable to open IO channel */
#define ERR_QIO 9 /*QIO system service error */
#define HELPSTR 10 /*Default help string */
#define TOFMSG 11 /*Top of memory file message */
#define BOFMSG 12 /*Bottom of memory file message */
#define AM_STRING 13 /*AM string */
#define PM_STRING 14 /*PM string */
#define EXHELPMSG 15 /*Press <Return> or <ESC> to exit help*/
#define SCRLHELPMSG 16 /*Use cursor pad keys to scroll */
#define EXITFORMMSG 17 /*Do you want to exit this form */
#define QUITFORMMSG 18 /*Do you want to quit this form */
#define EXCLISTMSG 19 /*Cursor keys to ... exit choice menu */
#define DATA_HELP 20 /*Data form default help string */
#define SCROLL_HELP 21 /*Scrollable subform help string */
#define MENU_HELP 22 /*Menu form help string */
#define NOVIRVB 23 /*No virtual video buffer */


/******************************************************************************/
/* */
/* Data structure definitions */
/* */
/******************************************************************************/

/*----------------------------------------------------------------------------*/
/* Major structure tags */
/*----------------------------------------------------------------------------*/
#define MF_TAG (((UINT) 'F' << 8) + 'M')
#define WN_TAG (((UINT) 'N' << 8) + 'W')
#define SCR_TAG (((UINT) 'C' << 8) + 'S')
#define VIEW_TAG (((UINT) 'W' << 8) + 'V')
#define HELP_TAG (((UINT) 'P' << 8) + 'H')
#define CL_TAG (((UINT) 'L' << 8) + 'C')

typedef struct node_struct /*NODE STRUCTURE */
{
struct node_struct *prev_ndp; /*previous node pointer */
struct node_struct *next_ndp; /*next node pointer */
PTR datap; /*data pointer */
} NODE, *NODEPTR;

.
.
.
 
Old 02-02-2010, 10:29 AM   #6
johnsfine
Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,107

Rep: Reputation: 1114Reputation: 1114Reputation: 1114Reputation: 1114Reputation: 1114Reputation: 1114Reputation: 1114Reputation: 1114Reputation: 1114
All the comments and #define's are filtered out before things like that typedef are parsed. So whatever the parser sees as incorrect and right before the typedef is apparently much further back. It could even be in some other .h file, depending on what is included where.

Maybe you want to try compiling with the -E option to get the intermediate result (after the preprocessor has dealt with the #define and similar, but before actually compiling). Then search for that typedef struct node_struct and see what is before it.

Last edited by johnsfine; 02-02-2010 at 10:34 AM.
 
Old 02-02-2010, 10:38 AM   #7
shawley
LQ Newbie
 
Registered: Oct 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks for all your help. The problemm was a #ifndef with a "endif" not a "#endif".
Thanks again for the help!
 
Old 02-02-2010, 10:41 AM   #8
shawley
LQ Newbie
 
Registered: Oct 2009
Posts: 12

Original Poster
Rep: Reputation: 0
I am looking but can't seem to find it. Is there a way to mark the problem resolved? Where? Thanks.
 
Old 02-02-2010, 11:06 AM   #9
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
upper right corner > thread tools > mark thread as solved
 
  


Reply

Tags
asm, attribute, compiler, err, expected, linux


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
libnet-functions.h:1432:error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before Jane2008 Linux - Newbie 2 11-13-2009 03:36 AM
ubuntu modem install (attempt) get:checking for asm/mach-default...** error neonwv Linux - Newbie 7 08-19-2009 07:52 AM
unable to resolve compilation error;./List.c:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ amolgupta Programming 3 01-09-2009 10:09 AM
ASM x32 vs ASM x64 Tegramon Programming 3 02-27-2008 02:26 PM
SDL_mixer_MMX.c:16: error: PIC register `ebx' clobbered in `asm' BGuy891653 Linux - Software 0 12-12-2004 06:31 PM


All times are GMT -5. The time now is 03:53 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration