Re: Compile Errors



On 11 Feb 2006 09:55:05 -0800, in comp.lang.c , "Technoid"
<dadams@xxxxxxxxxxxxxxxx> wrote:

I'm working on a legacy test platform with a compiler that expects K&R
style C (as opposed to ANSI). How does this affect the required syntax
for my code? Would it affect syntax for function prototypes?

Very much so, since K&R C doesn't allow prototypes AFAIR. You can have
declarations tho.

When I attempt to make or compile my C code, the compiler complains
about the syntax of the function prototypes, even though the syntax is
correct.

Example syntax:

void function_name(void);

This isn't valid pre-ANSI C. You need to remove the void, and any
other parameters, from the prototype to turn it into a plain old
declaration.
Mark McIntyre
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
.



Relevant Pages

  • Re: Compile Errors
    ... Would it affect syntax for function prototypes? ... When I attempt to make or compile my C code, ...
    (comp.lang.c)
  • Re: void parameter argument
    ... void function_name ... K&R C allowed function prototypes with "unspecified" arguments. ... the "" syntax was a necessary addition to distinguish ... between this non-disclosure and a declaration that a function took no ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Compile Errors
    ... Would it affect syntax for function prototypes? ...
    (comp.lang.c)
  • Compile Errors
    ... I'm working on a legacy test platform with a compiler that expects K&R ... How does this affect the required syntax ... Would it affect syntax for function prototypes? ...
    (comp.lang.c)
  • failed build for tk-8.4.5,1 and bittorrent
    ... error: syntax error before "ClientData" ... error: syntax error before "VOID" ... syntax er ror before "int" ... error: ...
    (freebsd-questions)