Coder Social home page Coder Social logo

Comments (10)

yuwata avatar yuwata commented on May 23, 2024 2

I am working on this.

from systemd.

poettering avatar poettering commented on May 23, 2024

The right fix for this issue is probably not just to fix the example, but to test-build all examples we ship as part of CI

from systemd.

bluca avatar bluca commented on May 23, 2024

It compiles and runs just fine here on bookworm, which version of gcc did you try it with?

$ gcc man/notify-selfcontained-example.c -o /tmp/notify
$

from systemd.

evverx avatar evverx commented on May 23, 2024
gcc -std=c99 ./man/notify-selfcontained-example.c

from systemd.

evverx avatar evverx commented on May 23, 2024

The right fix for this issue is probably not just to fix the example, but to test-build all examples we ship as part of CI

Agreed. As far as I know currently the headers are compiled but I'm not sure what's going on with the examples. To judge from #32030 (comment) at least some examples should be compiled as far as I understand but that's something @mrc0mmand probably knows better.

from systemd.

yuwata avatar yuwata commented on May 23, 2024

BTW, should the test code built with -std=gnu11, which is our default? Or, -std=c99 or something non-gnu standard?

from systemd.

evverx avatar evverx commented on May 23, 2024

As far as I can see at least the headers are compiled with all sorts of standards

src/systemd/meson.build:        foreach opt : ['-std=c++14',
src/systemd/meson.build:                       '-std=c++17',
src/systemd/meson.build:                       '-std=c++20',
src/systemd/meson.build:                       '-std=c++23',
src/systemd/meson.build:                       '-std=c++26',

because they can be embedded in all sorts of things. The example is supposed to be copy-pastable too so it should probably be compiled with -std=c*. (I just copy-pasted the example to a build system where it failed to compile spectacularly)

from systemd.

yuwata avatar yuwata commented on May 23, 2024

WIP branch -> #32057.

from systemd.

bluca avatar bluca commented on May 23, 2024

Turns out man/notify-selfcontained-example.c did compile on all tested combinations without changes, hence retitling accordingly

from systemd.

evverx avatar evverx commented on May 23, 2024

It doesn't. Without -D_GNU_SOURCE it isn't exactly self-contained. That being sad I poked it and it's useless because sd_notify usually comes with sd_listen and it's necessary to look at libsystemd anyway.

from systemd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.