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

xbill, motif: fix clang build #314766

Closed
wants to merge 2 commits into from
Closed

Conversation

paparodeo
Copy link
Contributor

@paparodeo paparodeo commented May 26, 2024

needs backport release-24.05 tag

Description of changes

motif:
ignore benign clang errors implicit-function-declaration and incompatible-function-pointer-types

xbill depends on motif but was also broken with clang is fixed as well:
ignore implicit-function-declaration errors and regenerate autotools files so configure test programs compile with clang

https://hydra.nixos.org/build/260342733
ZHF: #309482

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

ignore benign clang errors implicit-function-declaration and
incompatible-function-pointer-types
ignore implicit-function-declaration errors and regenerate autotools
files so configure test programs compile with clang
@paparodeo paparodeo changed the title motif: fix clang build xbill, motif: fix clang build May 26, 2024
@paparodeo
Copy link
Contributor Author

Result of nixpkgs-review pr 314766 run on x86_64-darwin 1

1 package marked as broken and skipped:
  • cernlib
5 packages built:
  • catclock
  • motif
  • nedit
  • snd
  • xbill

Result of nixpkgs-review pr 314766 run on x86_64-linux 1

1 package built:
  • xbill

@ofborg ofborg bot requested a review from alyssais May 26, 2024 06:36
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels May 26, 2024
@ofborg ofborg bot requested a review from herrwiese May 26, 2024 06:50
@ofborg ofborg bot added 10.rebuild-linux: 1-10 10.rebuild-linux: 1 and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels May 26, 2024
@alyssais
Copy link
Member

Are you sure they're benign? My understanding is that they'll only be benign if all implicitly declared functions return int, and take int for all arguments (or at least an equally sized type). (There's a reason Clang has made this an error by default.)

The right way to fix this would be to make sure there aren't any implicitly defined functions. I did that for Linux in #302635, but apparently it still needs some work for macOS.

@paparodeo
Copy link
Contributor Author

paparodeo commented May 26, 2024

Are you sure they're benign? My understanding is that they'll only be benign if all implicitly declared functions return int, and take int for all arguments (or at least an equally sized type). (There's a reason Clang has made this an error by default.)

The right way to fix this would be to make sure there aren't any implicitly defined functions. I did that for Linux in #302635, but apparently it still needs some work for macOS.

i did build on linux with clangStdenv for motif and xbill and implicit functions are usually due to missing the string.h and the warning is also present when compiling with gcc so it doesn't seem like it is fixed on linux but has the same issue. so yes, i believe that the behaviour for gcc and clang is now identical, as they are both ignoring the error.

[edit] as for the the function definition i thought that the size of the arguments is inferred from the argument type and the return value is an int is also inferred. i'd have to verify as i've never personally written c code which relies on using implicit function definitions but promotions are similar to variadic args like printf https://en.cppreference.com/w/c/language/operator_other#Function_call

@paparodeo
Copy link
Contributor Author

ah, i see that #302635 is still open. then closing this.

@paparodeo paparodeo closed this May 26, 2024
@paparodeo paparodeo deleted the motif-clang-fix branch May 26, 2024 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants