Function syntax (was: Porting Windows Apps to Wine) 
Author Message
 Function syntax (was: Porting Windows Apps to Wine)

[Followup-To: comp.lang.c.moderated]


Quote:
>: Here, Here!!  // is NOT a comment in C.
>Nor is the following valid C code:
>int foo(int a) {
>    return a;
>}

Uh... Why not?  I can't really see anything wrong with it...
--

The joy of engineering is to find a straight line on a double
logarithmic diagram.


Sun, 28 Jun 1998 03:00:00 GMT  
 Function syntax (was: Porting Windows Apps to Wine)
|> [Followup-To: comp.lang.c.moderated]
|>

|>
|> >: Here, Here!!  // is NOT a comment in C.

No, it is not, and it cannot be without breaking things, a point that
nobody in the entire original thread seems to have realized.  Consider:

     i = j //* */  3
       ;

|> >Nor is the following valid C code:
|> >int foo(int a) {
|> >      return a;
|> >}
|>
|> Uh... Why not?  I can't really see anything wrong with it...

It looks like legal ANSI C to me.  Perhaps the original poster
was speaking historically.  At one time, K&R C did not accept this
syntax, and it was put into C++ and the ANSI standard because a
number of people thought it was better.



Mon, 29 Jun 1998 03:00:00 GMT  
 Function syntax (was: Porting Windows Apps to Wine)
Quote:

> [Followup-To: comp.lang.c.moderated]


> >: Here, Here!!  // is NOT a comment in C.

That's right.

Quote:

> >Nor is the following valid C code:
> >int foo(int a) {
> >       return a;
> >}

> Uh... Why not?  I can't really see anything wrong with it...

Of course it is valid. It's ANSI C. Maybe you're using an
non ANSI compiler (on an older machine).
In "old" fashion it's like this:

int foo(a)
int a;
{
  return a;

Quote:
}

--

        http://www.fokus.gmd.de/ovma/employees/sayegh/entry.html
        signal(SIGSEGV,SIG_IGN);


Mon, 29 Jun 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. The virtue of porting Windows apps to Linux

2. The virtue of porting Windows apps to Linux

3. porting my app from ppc2002 to Windows CE .NET

4. C function problems during porting from UNIX to Windows

5. porting from win32 app to win32 console app

6. porting from win32 app to win32 console app

7. porting from win32 app to win32 console app

8. Porting from C++ to C# Syntax Question

9. problems porting ms inline assembly codes to linux (gnu - AT&T syntax)

10. Porting Windows 2000 program to windows 98

11. Over 3,000 syntax errors from cstdlib and cstdio when porting to VS.Net C++

12. Porting Windows 98 apllication to Windows 2000 problem.

 

 
Powered by phpBB® Forum Software