Menu

#187 Random fixes with current gcc and other clean ups

pending
nobody
None
2025-12-20
2025-12-08
No

I have my own tree that tracks this project, and I collected a bunch of changes that might be of more general interest.

Everything from trailing new lines, "bool" not being freely available anymore in C23, a bona fide bug, passing an int where a pointer to an int was sought, the dtmail project files weren't updated when source files were removed, lots of changes around prototypes because C23 became much more strict about things.

10 Attachments

Discussion

  • Jon Trulson

    Jon Trulson - 2025-12-14

    These are some great fixes I'd like to merge - but after the third one failed I gave up. I think they were made with an older version.

    Can you re-base these on current master so that they will apply cleanly? I'd gladly merge them.

     
  • Jon Trulson

    Jon Trulson - 2025-12-14
    • status: open --> pending
     
  • Jon Trulson

    Jon Trulson - 2025-12-14

    Awaiting new patches based on current master.

     
  • Patrick Georgi

    Patrick Georgi - 2025-12-14

    To avoid patch explosion if this needs more rounds, I'm sending the entire set as a git bundle now.

    Since they're a somewhat obscure feature, a short tutorial: download the file, in your CDE tree run git fetch path-to.gitbundle for-upstream and you'll have my "for-upstream" branch (that I created on top of current master) as your local branch "FETCH_HEAD".

    The branch gained a few more bugfixes, too.

     
    • Jon Trulson

      Jon Trulson - 2025-12-15

      Took a little investigating (never used git bundles before). But was able to get it in. A did a test build on Ubuntu 22.04 (gcc 11) and it failed:

      libtool: compile:  cc -DHAVE_CONFIG_H -I. -I../../include -DANSICPP -DMULTIBYTE -DNLS16 -D_POSIX_SOURCE -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -DUSE_XINERAMA -DUSE_XRENDER -DHAS_PAM_LIBRARY -DHAS_UTEMPTER_LIBRARY -I./il -I./jpeg -I../DtSvc/DtUtil2 -DDTLIB -DCDE_INSTALLATION_TOP=\"/usr/dt\" -DCDE_CONFIGURATION_TOP=\"/etc/dt\" -I../../include/Dt -I../../include/DtI -g -O2 -DOPT_TIRPC -I/usr/include/tirpc -Wno-unused-result -Wno-write-strings -fno-strict-aliasing -Wno-format-truncation -pthread -MT libDtHelp_la-StringFuncs.lo -MD -MP -MF .deps/libDtHelp_la-StringFuncs.Tpo -c StringFuncs.c  -fPIC -DPIC -o .libs/libDtHelp_la-StringFuncs.o
      In file included from /usr/include/X11/Intrinsic.h:54,
                       from /usr/include/Xm/Xm.h:59,
                       from /usr/include/Xm/XmP.h:40,
                       from ../../include/DtI/DisplayAreaP.h:50,
                       from FormatUtilI.h:50,
                       from FormatCCDF.c:88:
      FormatCCDF.c:160:5: error: expected identifier before numeric constant
        160 |     NormalState,
            |     ^~~~~~~~~~~
      

      and...

      FormatCCDF.c:2341:24: error: ‘LabelBody’ undeclared (first use in this function)
       2341 |     if (0 == result && LabelBody == cur_state)
            |                        ^~~~~~~~~
      

      and several warnings of the form

      FormatCCDF.c: In function ProcessParagraph:
      FormatSDL.c:718:45: warning: initialization of int (*)(void *, SDLMask *, enum SdlElement,  SDLMask *, SDLMask *) {aka int (*)(void *, long unsigned int *, enum SdlElement,  long unsigned int *, long unsigned int *)} from incompatible pointer type int (*)(FormatStruct *, SDLMask *, enum SdlElement,  SDLMask *, SDLMask *) {aka int (*)(struct _formatStruct *, long unsigned int *, enum SdlElement,  long unsigned int *, long unsigned int *)} [-Wincompatible-pointer-types]
        718 |         { SDLInitMask(SdlElementToss)     , ZeroOrOne }, \
            |                                             ^~~~~~~~~
      FormatSDL.c:1575:9: note: in expansion of macro SDL_ENTITY_GENERATED_ELEMENTS
       1575 |         SDL_ENTITY_GENERATED_ELEMENTS
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      FormatSDL.c:718:45: note: (near initialization for VStructContent[1].model)
        718 |         { SDLInitMask(SdlElementToss)     , ZeroOrOne }, \
            |                                             ^~~~~~~~~
      FormatSDL.c:1575:9: note: in expansion of macro SDL_ENTITY_GENERATED_ELEMENTS
       1575 |         SDL_ENTITY_GENERATED_ELEMENTS
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      FormatCCDF.c:2341:24: error: LabelBody undeclared (first use in this function)
       2341 |     if (0 == result && LabelBody == cur_state)
            |                        ^~~~~~~~~
      

      Not sure what it would do on other systems like FreeBSD - I no longer have the "build farm" running. But if you have fixes, I would love to get these in - great work.

       
  • Patrick Georgi

    Patrick Georgi - 2025-12-16

    Updated bundle. It contains another commit to fix the NormalState/LabelBody issue and I extended another commit about bool handling to include stdbool.h - required with clang19.
    Still lots to do until everything builds with modern compilers, but making progress.

     
  • Patrick Georgi

    Patrick Georgi - 2025-12-17

    I now set up a system with an older compiler to work on these things more incrementially and with much better testing. I'll create a new ticket once I have a verified patch set, please close this.

     
  • Patrick Georgi

    Patrick Georgi - 2025-12-19

    I'm running CDE built with gcc14 and the attached patches. It doesn't contain everything I have in that more comprehensive patch set, but on the upside: it builds and runs.

    Sorry for the mess with the unclean patch set!

     

    Last edit: Patrick Georgi 2025-12-19
    • Jon Trulson

      Jon Trulson - 2025-12-20

      Hi, I was able to build this one without problems, thanks! Will merge this one. Did you still want me to close this ticket?

       

Log in to post a comment.