Weird Warning

This is a discussion on Weird Warning within the C++ Programming forums, part of the General Programming Boards category; Hey, What the hell does this warning mean? Its confusing me as to why it would say its a warning... ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    44

    Question Weird Warning

    Hey,

    What the hell does this warning mean? Its confusing me as to why it would say its a warning...

    mud.h:1:1: warning: C++ style comments are not allowed in ISO C89
    mud.h:1:1: warning: (this will be reported only once per input file)

    Any explination of why this occured would be most helpfull, it spams the hell outa my terminal when I'm trying to work bugs out.

    Thanks,
    Jase
    [Strut]

    I lay on my bed watching the stars, and I thought to myself... Where the hell is my roof?

  2. #2
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    C++ style comments, double slashes (IE, //) are not allowed in older C89 code, but they are acceptable in C99.

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    44

    -hmm-

    So how can I tell which one I'm using? I mean obviousley I'm using C89, but is it due to the compiler, or my code?
    Last edited by Strut; 01-08-2003 at 01:52 AM.
    [Strut]

    I lay on my bed watching the stars, and I thought to myself... Where the hell is my roof?

  4. #4
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    It's the combination of using // in a C89 compiler (or at least, one that is issuing warnings about it).

    You can either

    A. Change every // comment to /* */
    B. Find the compiler flag to turn off the warnings
    C. Just let them spam your screen.
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

  5. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    44
    Ah, figured as much. I've already begun looking for the flag, I'm programming under linux-gnu, using gcc. Thanks for the help.
    [Strut]

    I lay on my bed watching the stars, and I thought to myself... Where the hell is my roof?

  6. #6
    NoOneHere
    Guest
    why not use the g++ compiler (that is if your using red hat)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 10
    Last Post: 07-10-2008, 03:45 PM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. <Gulp>
    By kryptkat in forum Windows Programming
    Replies: 7
    Last Post: 01-14-2006, 12:03 PM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21