Skip to content

todo: use same CFLAGS for all demos (general pass for each ./demo/*/Makefile) #895

@sleeptightAnsiC

Description

@sleeptightAnsiC

We have some differences in how each demo is being build. This creates few problems mentioned below. I want to make a pass on all of them and make all compilation flags consistent. Here are the changes that I'm considering:

  1. Ensure optimizations are disabled with -O0. Currently, few demos use -O2 and waste our CI time. (reference: demo/sdl3_renderer: rewrite Makefile in order to support Emscripten #894 (comment) )
  2. Ensure that debug symbols are enabled with -g. This will allow for better debugging without affecting compilation times as much. (I'm still not entirely sure, if it's worth it, but I think it is, GCC enables this by default anyway)
  3. Ensure the same C standard with -std=c99 (?) I think some people may disagree so I will quickly explain: Nuklear itself is C89 but the demos are not. Most of the demos already need C99 in some form or another, and even if you aren't getting any pedantic warnings with your setup, you will get them after using #define INCLUDE_ALL. We can keep the backend headers C89 compliant, but we should compile the demos with C99. This was allowed many years ago with 177f391 and if someone disagree, then we should consider rewriting the demos with C89 in mind and reverting said rule, instead of lying about the support with -std=c89. Right now, people are wasting their time for submitting "warning fixes" that someone is about to reintroduce anyway. (EDIT: after grepping the demos, it seems like most are using -std=c89 so maybe my take wasn't so accurate after all, I still think we should talk about it though)
  4. Ensure we have the same warnings enabled with -Wall -Wextra -pedantic. Any ideas for other flags? We haven't tested with anything else, but maybe we should...
  5. Add missing CIs as few demos do not have them (and this is must have when changing so much stuff)
  6. I could also fix this one at the same time: Demo has dependencies and contains paths specific to individual developers' machines #813
  7. More... ?

Any thoughts?

cc @RobLoach @rswinkle

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions