Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Silence misc warnings #976

Closed
wants to merge 3 commits into from
Closed

Conversation

andreittr
Copy link
Contributor

Description of changes

This patch set silences several build warnings: inappropriate or compiler-specific flags & unused variables.

Prerequisite checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran the checkpatch.uk on your commit series before opening this PR;
  • Updated relevant documentation.

Base target

  • Architecture(s): N/A
  • Platform(s): N/A
  • Application(s): N/A

Additional configuration

N/A

@andreittr andreittr requested review from a team as code owners July 12, 2023 08:42
Makefile.uk Outdated
@@ -91,7 +91,8 @@ M4FLAGS += -DUK_VERSION=$(UK_VERSION).$(UK_SUBVERSION)
COMPFLAGS-$(call gcc_version_ge,6,1) += -fno-PIC
LDFLAGS-$(call gcc_version_ge,6,1) += -no-pie
ifeq ($(call gcc_version_ge,10,0),y)
COMPFLAGS-y += -fhosted -fno-tree-loop-distribute-patterns
COMPFLAGS-y += -fno-tree-loop-distribute-patterns
CFLAGS-y += -fhosted
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As -fhosted is the default, I think we can also remove it (nolibc will set -ffreestanding)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point, although I would prefer to have even default options explicitly stated in our makefiles, both for documentation purposes and for the super unlikely case defaults change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern is that having conflicting options for the compiler also creates a subtle dependency on the flag ordering.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point re: arg ordering; I'll remove -fhosted and leave it to be implicit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated; removed -fhosted entirely.

@unikraft-bot unikraft-bot added area/lib Internal Unikraft Microlibrary area/makefile Part of the Unikraft Makefile build system lang/c Issues or PRs to do with C/C++ lib/devfs devfs file system lib/syscall_shim lib/ukallocbbuddy labels Jul 12, 2023
@razvand razvand removed request for a team July 24, 2023 19:44
@razvand razvand assigned razvand and skuenzer and unassigned nderjung and razvand Jul 24, 2023
@razvand razvand added this to the v0.14.0 (Prometheus) milestone Jul 24, 2023
Copy link

@rares-miculescu rares-miculescu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello! All worked well on my side.
Thank you, @andreittr!

Reviewed-by: Rares Miculescu miculescur@gmail.com

@unikraft-bot
Copy link
Member

Checkpatch passed

Beep boop! I ran Unikraft's checkpatch.pl support script on your pull request and it all looks good!

SHA commit checkpatch
f82840a build: Remove default C-specific -fhosted flag
a6d910c lib/syscall_shim: Make compiler flag GCC-specific
6ae50be lib/*: Remove unused variables

Copy link
Member

@mschlumpp mschlumpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

Reviewed-by: Marco Schlumpp marco@unikraft.io

Copy link
Contributor

@razvand razvand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved-by: Razvan Deaconescu razvand@unikraft.io

Copy link
Member

@mschlumpp mschlumpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to check the "Approve" radio button.

Reviewed-by: Marco Schlumpp marco@unikraft.io

This change removes the -fhosted flag as it is default for C code,
also silencing a warning that appears when compiling C++ code.

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
-Wno-builtin-declaration-mismatch is only supported by GCC.

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Removes unused counter variables that were triggering compiler warnings.

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
@nderjung nderjung assigned razvand and unassigned skuenzer Aug 7, 2023
unikraft-bot pushed a commit that referenced this pull request Aug 7, 2023
-Wno-builtin-declaration-mismatch is only supported by GCC.

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Rares Miculescu <miculescur@gmail.com>
Reviewed-by: Marco Schlumpp <marco@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #976
unikraft-bot pushed a commit that referenced this pull request Aug 7, 2023
Removes unused counter variables that were triggering compiler warnings.

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Rares Miculescu <miculescur@gmail.com>
Reviewed-by: Marco Schlumpp <marco@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #976
@unikraft-bot unikraft-bot added the ci/merged Merged by CI label Aug 7, 2023
@andreittr andreittr deleted the ttr/warns branch August 7, 2023 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/lib Internal Unikraft Microlibrary area/makefile Part of the Unikraft Makefile build system ci/merged Merged by CI lang/c Issues or PRs to do with C/C++ lib/devfs devfs file system lib/syscall_shim lib/ukallocbbuddy
Projects
Status: Done
Status: Done!
Development

Successfully merging this pull request may close these issues.

None yet

7 participants