fuzziqersoftware / phosg

C++ helpers for some common tasks
18 stars 17 forks source link

Error in Strings.cc #6

Closed JimmieJoeJr closed 3 years ago

JimmieJoeJr commented 3 years ago

g++ -fPIC -std=c++14 -g -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -Wall -Werror -DLINUX -c -o Strings.o Strings.cc Strings.cc: In function ‘size_t parse_size(const char*)’: Strings.cc:790:26: error: conversion from ‘long long unsigned int’ to ‘size_t’ {aka ‘unsigned int’} changes value from ‘1099511627776’ to ‘0’ [-Werror=overflow]

define TB_SIZE (GB_SIZE * 1024ULL)

             ~~~~~~~~~^~~~~~~~~~

Strings.cc:864:18: note: in expansion of macro ‘TB_SIZE’ unit_scale = TB_SIZE; ^~~ Strings.cc:791:26: error: conversion from ‘long long unsigned int’ to ‘size_t’ {aka ‘unsigned int’} changes value from ‘1125899906842624’ to ‘0’ [-Werror=overflow]

define PB_SIZE (TB_SIZE * 1024ULL)

             ~~~~~~~~~^~~~~~~~~~

Strings.cc:866:18: note: in expansion of macro ‘PB_SIZE’ unit_scale = PB_SIZE; ^~~ Strings.cc:792:26: error: conversion from ‘long long unsigned int’ to ‘size_t’ {aka ‘unsigned int’} changes value from ‘1152921504606846976’ to ‘0’ [-Werror=overflow]

define EB_SIZE (PB_SIZE * 1024ULL)

             ~~~~~~~~~^~~~~~~~~~

Strings.cc:868:18: note: in expansion of macro ‘EB_SIZE’ unit_scale = EB_SIZE; ^~~ cc1plus: all warnings being treated as errors make: *** [: Strings.o] Error 1

JimmieJoeJr commented 3 years ago

The environment was built following this guide: https://cdromrom.wordpress.com/2020/12/05/phantasy-star-online-gamecube-server-on-raspberry-pi/

fuzziqersoftware commented 3 years ago

Thanks for the report. I had dropped support for 32-bit environments a while ago, but I suppose I still need to support them for cases like this. I've fixed this case by reverting the relevant commit, but I don't have access to my own Raspberry Pi right now to test further. Feel free to reopen this if it still doesn't build.