Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Does this server is vuln. to buffer overflow?

  1. #11
    Leftie Linux Lover the_JinX's Avatar
    Join Date
    Nov 2001
    Location
    Beverwijk Netherlands
    Posts
    2,534
    Yeah.. I've noticed..
    even with the -ansi flag or worse yet -std=gnu89

    I allways thought an empty main() was only allowed in C++


    /me looks for his "A Book on C" and "C++ for C programmers" books..
    ASCII stupid question, get a stupid ANSI.
    When in Russia, pet a PETSCII.

    Get your ass over to SLAYRadio the best station for C64 Remixes !

  2. #12
    Banned
    Join Date
    Jul 2005
    Posts
    511
    Since C is just a subset of the C++ language, it's correct to call it C++. Even though C is an older language than C++, it doesn't mean it won't compile in a C++ compiler.
    That's actually what C++ means... It's C plus some additional functionality.

  3. #13
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    Originally posted here by the_JinX
    Yeah.. I've noticed..
    even with the -ansi flag or worse yet -std=gnu89

    I allways thought an empty main() was only allowed in C++
    Main isn't empty. It's defined to return an int.. int main() {...}.
    IIRC it's correct to define an empty (void) parameter list.

    http://www.comeaucomputing.com/techtalk/#voidmain
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  4. #14
    Banned
    Join Date
    May 2003
    Posts
    1,004
    Since C is just a subset of the C++ language
    Actually C++ is a superset of C.

    cheers,

    catch

    PS. Please don't both to neg me with "wah! supersets must contain subsets!" I was being facetious.

  5. #15
    Senior Member
    Join Date
    Jul 2003
    Posts
    813
    The code is ANSI C Yes, ANSI, you're allowed to declare main() like that in ANSI C but not in C++. The includes for C++ usually don't keep the .h suffix.

    In terms of warnings I'd append -Wall to my flags as a general good practice.
    /\\

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •