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

error when enabling -Werror=double-promotion on software using this library #249

Open
alex-tee opened this issue Apr 23, 2022 · 5 comments

Comments

@alex-tee
Copy link

Experienced behavior

次のファイルから読み込み:  /usr/include/graphene-1.0/graphene.h:38,
         次から読み込み:  /usr/include/gtk-4.0/gsk/gsktypes.h:25,
         次から読み込み:  /usr/include/gtk-4.0/gsk/gskrenderer.h:26,
         次から読み込み:  /usr/include/gtk-4.0/gsk/gsk.h:24,
         次から読み込み:  /usr/include/gtk-4.0/gtk/gtk.h:32,
         次から読み込み:  ../inc/utils/yaml.h:29,
         次から読み込み:  ../inc/audio/curve.h:33,
         次から読み込み:  ../inc/audio/automation_point.h:29,
         次から読み込み:  ../inc/audio/region.h:28,
         次から読み込み:  ../src/gui/widgets/event_viewer.c:4:
/usr/include/graphene-1.0/graphene-simd4x4f.h: 関数 ‘graphene_simd4x4f_init_look_at’ 内:
/usr/include/graphene-1.0/graphene-simd4x4f.h:659:51: エラー: implicit conversion from ‘float’ to ‘double’ to match other operand of binary expression [-Werror=double-promotion]
  659 |       if (fabs (graphene_simd4f_get_z (up) - 1.0) < FLT_EPSILON)

Expected behavior

No error

Steps to reproduce

  1. add -Werror=double-promotion to CFLAGS and include <gtk/gtk.h>

Operating system in use

arch linux (parabola)

SIMD implementation in use

not sure but this might say: /usr/include/graphene-1.0/graphene-simd4x4f.h

Graphene version

1.10.8

@alex-tee
Copy link
Author

alex-tee commented Aug 15, 2022

also getting more issues with -Werror=conversion

/usr/include/graphene-1.0/graphene-rect.h:51:40: エラー: conversion from ‘int’ to ‘float’ may change value [-Werror=conversion]
   51 |   (graphene_rect_t) { .origin = { .x = (_x), .y = (_y) }, .size = { .width = (_w), .height = (_h) } }

although this is probably the fault of my own source code when using the macros

EDIT: pls ignore this, this was my own fault

@alex-tee
Copy link
Author

alex-tee commented Aug 15, 2022

https://github.com/alex-tee/graphene-test

here is a simple meson project to reproduce it, just run meson build and meson compile -C build and you should get this error

@ebassi
Copy link
Owner

ebassi commented Jan 23, 2024

The short answer is: do not enable compiler errors with external libraries that have made no guarantee whatsoever about those same errors.

The longer answer is: patches welcome.

@tristan957
Copy link

Hey ebassi,

What would a PR look like here that you would deem acceptable?

  • Fixing only the warnings in the public headers
  • Fixing all the warnings

I'm also more than happy to work around this downstream if you're not ready to accept a patch at this time.

@ebassi
Copy link
Owner

ebassi commented Aug 12, 2024

I would accept a pull request that fixed the header files, assuming it's not going to make them completely unreadable.

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

3 participants