Menu

#484 ANSI C compatible initialisation of default object styles

Version 5
closed-out-of-date
5
2022-10-25
2010-06-17
No

At the moment the initialisation of the unions DEFAULT_RECTANGLE_STYLE, DEFAULT_CIRCLE_STYLE, DEFAULT_ELLIPSE_STYLE, and DEFAULT_POLYGON_STYLE does not conform to C89 standard (used e.g. by the Microsoft Visual C compiler). The attached patch
converts the incompatible parts of the initialisation to an assignment.

1 Attachments

Discussion

  • Alexander Täschner

    Patch

     
  • Ethan Merritt

    Ethan Merritt - 2010-10-28
    • status: open --> open-rejected
     
  • Ethan Merritt

    Ethan Merritt - 2010-10-28

    The C99 standard is already 12 years old. I think it is reasonable to expect that people can find a compiler that is less than a decade out of date. We should be moving forward, however slowly, rather than backward. By the same token, I'd like to see the code to use snprintf() everywhere.

     
  • Nobody/Anonymous

    I perfectly agree that it is the compiler that should be fixed. On the other hand, Visual C is a quasi standard on Windows (the Express variant is available for free). Personally, I am using the 2008 version because of its debugger and superior compilation speed.

    Would you please reconsider this patch (or something similar)?

     
  • Bastian Märkisch

    Forgot to log in. The last comment was by me.

     
  • Ethan Merritt

    Ethan Merritt - 2012-03-13
    • status: open-rejected --> closed-rejected
     
  • Bastian Märkisch

    • status: closed-rejected --> open-rejected
     
  • Bastian Märkisch

    This extended version of the patch introduces a new preprocessor define WITH_C89, which is currently only set by config/config.nt.
    I am leaving this patch open so that it can be found more easily.

     
  • Bastian Märkisch

    Revised version of the patch, updated to current CVS

     
  • Ethan Merritt

    Ethan Merritt - 2013-12-30

    According to its documentation, MSVC 2013 now supports C99/ANSI-C named field initialization.

     
  • Alexander Täschner

    MSVC 2013 indeed supports the used initializations, I just compiled the code without the patch successfully.

     
  • Bastian Märkisch

    • labels: --> Windows, MSVC
    • assigned_to: Bastian Märkisch
    • Group: -->
     
  • Bastian Märkisch

    This is great news. Until glib/pango/cairo etc. can officially be build by MSVC 2013, we might have to stick to 2012 or earlier, though. Hence, I updated my patch to current CVS.

     
  • Bastian Märkisch

    • status: open-rejected --> closed-out-of-date
    • Group: --> Version 5
     

Log in to post a comment.