Open JUNZ1 opened 3 years ago
If this enhancement will not be used often, can it be worked around with a few lines of script?: No
Come on, it can xD you can cast it.
Is there a reason why this should be core and not an add-on in the asset library?: All the size values should be unsigned int for better logical comparison
If this is the actual request then that should be done inside Godot because all containers there use int
, not even size_t
.
I face compilation warning(s) because of comparing it with unsigned int value
There will be no more warning :)
You can use various warning build options like werror=no
and warnings=no
while compiling Godot.
If that doesn't work, this proposal might as well be qualified as a bug report.
I dont think "muting all warning" is the solution for this problem.. any developer should keep them on not to miss any probable future problem..
Do you use GCC? I use unsigned ints in a custom Godot module and while MSVC never complained for years with me, when I started setting up a CI with GCC, it started warning about every single bit of mix between int and unsigned int, which prevents the CI from suceeding the compilation since warning as error is used. At first it sounds like "oh, thats a bad use anyway, the developer should fix it" but even though I'm doing my best, it's surprising how often this can happen and how annoying this can be when MSVC doesnt warn about it the same way GCC does:
int
, which causes the warning when I use my own unsigned ints so I have to castsize_t
, which causes the warning when I have to use it with ints that came from Godot so I have to castsize_t
or uint64_t
is currently ambiguous with some compiler when constructing a Variant
from itint64_t
so again you need to care about this when comparing this to unsignedAt least I start to understand why Godot prefers int
generally in places where negatives would not be expected :p
Yes I use GCC, if you ask me these warnings just fork fine, they do their job :D, problem is warnings can not create issues themself :), some one has to create issue about them :)
Describe the project you are working on: Creating CPP Module for a Machine Learning Module
Describe the problem or limitation you are having in your project: I face compilation warning(s) because of comparing it with unsigned int value
Describe the feature / enhancement and how it helps to overcome the problem or limitation: There will be no more warning :)
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams: By changing the return argument of the interface
If this enhancement will not be used often, can it be worked around with a few lines of script?: No
Is there a reason why this should be core and not an add-on in the asset library?: All the size values should be unsigned int for better logical comparison