Menu

#66 C89 style comments to prevent warnings

None
closed
None
1
2016-02-28
2016-02-27
No

Some comments used C99 or C++ style which are not part of C89 standard and because of using pedantic, a few warnings were shown.

Thanks!

1 Attachments

Discussion

  • Molnár Károly

    Molnár Károly - 2016-02-27
    • assigned_to: Molnár Károly
     
  • Molnár Károly

    Molnár Károly - 2016-02-27

    Thank you for patch. I applied in the svn [r1190] version.

    Károly

     
  • Diego Herranz

    Diego Herranz - 2016-02-27

    Out of curiosity, why the leading '?' in /trunk/gputils/gputils/gpdasm.c?

     
  • Molnár Károly

    Molnár Károly - 2016-02-28

    This the '?' synonym of the 'h'. But it seems that does not work. :-/ In fact, there is no need, for this purpose already exists in the "-h" or "--help". I think I'm going to throw the '?' option.

     
  • Molnár Károly

    Molnár Károly - 2016-02-28

    This works, just I'm looking at something badly.

     
  • Diego Herranz

    Diego Herranz - 2016-02-28

    I think it's not needed.

    Reading http://linux.die.net/man/3/getopt_long:

    If getopt() finds an option character in argv that was not included in optstring, or if it detects a missing option argument, it returns '?' and sets the external variable optopt to the actual option character.

    And in fact, because of the following, I think we should better remove it.

    If the first character (following any optional '+' or '-' described above) of optstring is a colon (':'), then getopt() returns ':' instead of '?' to indicate a missing option argument. If an error was detected, and the first character of optstring is not a colon, and the external variable opterr is nonzero (which is the default), getopt() prints an error message.

    Thanks!

     
  • Molnár Károly

    Molnár Károly - 2016-02-28

    You're right, more eyes see more. I deleted the unnecessary '-?' option. [r1193]

    Károly

     
  • Diego Herranz

    Diego Herranz - 2016-02-28

    Thanks Károly!

     
  • Molnár Károly

    Molnár Károly - 2016-02-28
    • status: open --> closed
     

Anonymous
Anonymous

Add attachments
Cancel