Article View: csu.cs.200
Article #195Re: Help with aCC compiling errors
From: root
Date: Fri, 02 Oct 1998 00:00
Date: Fri, 02 Oct 1998 00:00
58 lines
2552 bytes
2552 bytes
spasm <spasm@holly.colostate.edu> wrote:
: Using the old CC command to compile my assignment #3 program, I recieved
: no errors and achieved the desired output. Using the new aCC command to
: compile my program, I get the following errors:
: 1. Error (future) 355: "Main3.C", line 46 # Function 'main' must return
: type 'int'.
: void main()
: ^^^^
aCC is a stricter compiler .. so U need to return a value before exiting
So use int main() instead of void main()
^^^ ^^^^
and before u exit from the main, use
return(1) ---> for abnormal termination
return(0) ---> for normal termination
: 2. Error 409: "Main3.C", line 128 # Cannot convert a non-lvalue to a
: pointer.
: if(strcmp((LIST_Get(list,j)).name,(LIST_Get(list,index)).name) >
: 0) ^^^^^^^^^^^^^^^^^^^^^^
Yep .. this doesn't work with aCC ..
U need to assign LIST_Get(list,j).name to a termorary character string
and then compare the temp string.
It works with aCC tho.
: 3. Error 409: "Main3.C", line 128 # Cannot convert a non-lvalue to a
: pointer.
: if(strcmp((LIST_Get(list,j)).name,(LIST_Get(list,index)).name) >
: 0)
: ^^^^^^^^^^^^^^^^^^^^^^^^^^
Same as above
: 4. Warning: 1 future errors were detected and ignored. Add a '+p'
: option to
: detect and fix them before they become fatal errors in a future release.
: Behavio
: r of this ill-formed program is not guaranteed to match that of a
: well-formed pr
: ogram
: After adding the '+p' option, error 355 is gone. The file Main3.C is
: supposed to compile, so I'm guessing that there is something in my SLL.h
: and ArrD.h files that is causing the problem. I get the same errors
: including either SLL.h or ArrD.h in Main3.C. Any ideas as to what could
: be causing this.
: Thanx,
: Chris Carlson
--
VISHWANATH PARAKALA
__________________________________________________________________________
Home Page: http://www.cs.colostate.edu/~vishu
finger : vishu@schubert.cs.colostate.edu
Technical Details
Message-ID:
<6v15mc$8uo4@yuma.ACNS.ColoState.EDU>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3612620F.C024CCAE@holly.colostate.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 127144,ebc15a71af1aa21f X-Google-Attributes: gid127144,public From: <root@firefly.engr.colostate.edu> Subject: Re: Help with aCC compiling errors Date: 1998/10/02 Message-ID: <6v15mc$8uo4@yuma.ACNS.ColoState.EDU> X-Deja-AN: 396873739 References: <3612620F.C024CCAE@holly.colostate.edu> Organization: Colorado State University, Fort Collins, CO 80523 User-Agent: tin/pre-1.4-980226 (UNIX) (Linux/2.0.34 (i686)) Newsgroups: csu.cs.200