lib/ukboot: cast constructor pointer when calling with arguments by titouanc · Pull Request #1916 · unikraft/unikraft · GitHub
Skip to content

lib/ukboot: cast constructor pointer when calling with arguments - #1916

Open
titouanc wants to merge 1 commit into
unikraft:stagingfrom
titouanc:tc/fix-ctor-args-cast
Open

titouanc wants to merge 1 commit into
unikraft:stagingfrom
titouanc:tc/fix-ctor-args-cast

Conversation

@titouanc

@titouanc titouanc commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Recent GCC versions are more stringent on type correctness than before.
For example, GCC 16.2 uses C23 by default, which yields this build error:

lib/ukboot/boot.c: In function ‘do_main’:
lib/ukboot/boot.c:489:18: error: too many arguments to function ‘*ctorfn’;
                          expected 0, have 2
489 |                 (*ctorfn)(argc, argv);
    |                 ~^~~~~~~~ ~~~~

Add an explicit cast to the "main" function type signature at call site.

@github-actions github-actions Bot added area/lib Internal Unikraft Microlibrary lang/c Issues or PRs to do with C/C++ lib/ukboot labels Oct 3, 2026
@michpappas
michpappas requested a review from mogasergiu October 5, 2026 14:39
Recent GCC versions are more stringent on type correctness than before.
For example, GCC 16.2 uses C23 by default, which yields this build error:

    lib/ukboot/boot.c: In function ‘do_main’:
    lib/ukboot/boot.c:489:18: error: too many arguments to function ‘*ctorfn’;
                              expected 0, have 2
    489 |                 (*ctorfn)(argc, argv);
        |                 ~^~~~~~~~ ~~~~

Add an explicit cast to the "main" function type signature at call site.

Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
@titouanc
titouanc force-pushed the tc/fix-ctor-args-cast branch from ccbe6a9 to 45c0cd4 Compare October 13, 2026 20:23
@titouanc

Copy link
Copy Markdown
Contributor Author

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/lib Internal Unikraft Microlibrary lang/c Issues or PRs to do with C/C++ lib/ukboot

Projects

Status: 🧊 Icebox

Development

Successfully merging this pull request may close these issues.

2 participants