Thread: What is a "old-style format list"

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    4

    What is a "old-style format list"

    When I make this mistake in C programming:
    Code:
    void myF(); //Extra semi colon here
    {
    printf("hello");
    }
    I get this error in MSVC:

    error C2447: '{' : missing function header (old-style formal list?)

    WTF is a old-style formal list ? What did the syntax use to be? I was under the impression C syntax hasn't changed for a quite while. No other syntax errors give you this kind of error message.

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Code:
    void myF();
    This is K&R syntax, which means it predates the 1989 standard.
    Last edited by Dave_Sinkula; 11-18-2005 at 09:09 PM.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    C existed before there was a C standard. I suspect the "old-style formal list" is referring to the fact that this, in standard C;
    Code:
    int Function(int x, char *y)
    {
         /* whatever */
    }
    was actually expressed in pre-standard C as;
    Code:
    int Function(x, y)
       int x;
       char *y;
    {
         /* whatever */
    }
    The lines declaring types of arguments were referred to as a "formal argument list".

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. GradeInfo
    By kirksson in forum C Programming
    Replies: 23
    Last Post: 07-16-2008, 03:27 PM
  2. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  3. Compression/Decompression Wave File and MP3
    By cindy_16051988 in forum Projects and Job Recruitment
    Replies: 51
    Last Post: 04-29-2006, 06:25 AM
  4. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM