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

Prevent implicit double conversion #273

Merged
merged 1 commit into from
May 24, 2020

Conversation

astrelsky
Copy link
Contributor

Pull Request checklist

Note: these are not necessarily requirements

  • I reformatted the code with clang-format
  • I checked to make sure my submission worked
  • I am the author of submission or have permission from the original author
  • Requires update of the PS2SDK
  • Requires update of the gsKit
  • Others (please specify below)

Pull Request description

It may be a good idea to use -fsingle-precision-constant as a further measure to prevent this.

@rickgaiser
Copy link
Member

Nice catch. Can you add -fsingle-precision-constant to the Makefile too?

diff --git a/Makefile b/Makefile
index 964978b..689043c 100644
--- a/Makefile
+++ b/Makefile
@@ -98,6 +98,7 @@ EE_OBJS_DIR = obj/
 EE_ASM_DIR = asm/
 
 MAPFILE = opl.map
+EE_CFLAGS = -fsingle-precision-constant
 EE_LDFLAGS += -Wl,-Map,$(MAPFILE)
 
 EE_LIBS = -L$(PS2SDK)/ports/lib -L$(GSKIT)/lib -L./lib -lgskit -ldmakit -lgskit_toolkit -lpoweroff -lfileXio -lpatches -ljpeg -lpng -lzlib -ldebug -lm -lmc -lfreetype -lvux -lcdvd -lnetman -lps2ips -laudsrv

@astrelsky
Copy link
Contributor Author

-fsingle-precision-constant

Done. -Werror=double-promotion can be added when build with the new toolchain. It is only present in gcc 4.6.3 and up.

@rickgaiser
Copy link
Member

Thanks, looks good. I'll try my new powers and see if I can merge this one.

@rickgaiser rickgaiser merged commit 67caaf7 into ps2homebrew:master May 24, 2020
@astrelsky astrelsky deleted the single_precision branch May 24, 2020 14:32
AKuHAK pushed a commit that referenced this pull request Sep 30, 2021
Prevent implicit double conversion
citronalco pushed a commit to citronalco/OPL-Daily-Builds that referenced this pull request Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants