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

sign conversion error prevents build #2582

Closed
VictorEijkhout opened this issue Jun 22, 2023 · 7 comments
Closed

sign conversion error prevents build #2582

VictorEijkhout opened this issue Jun 22, 2023 · 7 comments

Comments

@VictorEijkhout
Copy link

/Users/eijkhout/Installation/sfml/sfml-2.6.0/src/SFML/System/Unix/ClockImpl.cpp: In static member function 'static sf::Time sf::priv::ClockImpl::getCurrentTime()':
/Users/eijkhout/Installation/sfml/sfml-2.6.0/src/SFML/System/Unix/ClockImpl.cpp:50:41: error: conversion to 'sf::Int64' {aka 'long long int'} from 'sf::Uint64' {aka 'long long unsigned int'} may change the sign of the result [-Werror=sign-conversion]
   50 |     return sf::microseconds(nanoseconds / 1000);
      |                             ~~~~~~~~~~~~^~~~~~
cc1plus: all warnings being treated as errors
@ChrisThrasher
Copy link
Member

ChrisThrasher commented Jun 22, 2023

Can you please provide information on your build environment and how someone may go about reproducing this?

As a workaround you can simply disable warnings as errors by setting the cache variable WARNINGS_AS_ERRORS to OFF and the library will build.

@VictorEijkhout
Copy link
Author

I was building with gcc 12 on MacOS.

@ChrisThrasher
Copy link
Member

GCC fails on macOS for reasons related to Apple system headers. Once you disable WARNINGS_AS_ERRORS you'll probably run into them. Use AppleClang or Clang instead.

@VictorEijkhout
Copy link
Author

Ah. Just ran into that indeed. I'll try clang.

@ChrisThrasher
Copy link
Member

We'd like to support GCC on macOS but simply don't know how to fix the compilation errors. I'm closing this issue since it seems like the error was limited to that compiler+OS combo.

@eXpl0it3r eXpl0it3r closed this as not planned Won't fix, can't repro, duplicate, stale Jun 28, 2023
@barracuda156
Copy link

ghost commented Aug 7, 2023

Why was this closed? It looks like a bug to fix.

@eXpl0it3r
Copy link
Member

See also: #2790

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@VictorEijkhout @eXpl0it3r @ChrisThrasher and others