-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
introduce csize_t instead of fixing csize #12497
Conversation
Yeah but the idea was not to break code. I personally would replace |
Can you please stop bringing this up again and again. The c++ committee even agreen on this, happy about that? But that is totally not the point here. The issue here that I try to solve is
Does that mean that you will do it? Or is that your review advice for this PR? |
After a long discussion, here is what we agreed on: The changes to |
Is a bit weird how you want avoid a direct usage of unsigned types, another example is the Natural type, has a range from 0 to the maximum positive of a int instead using an unsigned int for that |
Maybe it's because I know the semantic implications. |
Rename to WV_CacheLinePadding Unfortunately nim-lang/Nim#12722 broke Nim devel in the past 3 days, commit nim-lang/Nim@1b2c1bc is good. Also C proc signatures changed to csize_t nim-lang/Nim#12497
|
@xflywind the names are directly from C. And in C the type definition is called https://stackoverflow.com/questions/55190317/where-is-ssize-t-defined-in-linux |
@krux02 |
Implement the proposal by @Araq in #12447 (comment)_
It is actually harder to maintain backwards compatibility with this change instead of #12321. Explicit conversions like
csize(x)
orcast[csize](x)
would work no matter ifcsize
is defined asint
oruint
. The new typecsize_t
and deprecatingcsize
forces user ofcsize
into one of these options:csize_t
csize_t
into the project with somewhen declared
condition.csize
/csize_t
all together and useint
/uint
directly.This still does break backwards compatibility, since I did change functions that return
csize
to returncsize_t
now. The alternative would be to introduce new names, for example:proc c_strlen*(a: cstring): csize
andproc c_strlen2*(a: cstring): csize_t
. I also didn't introduce a new typeGlob2
next toGlob
where the membersgl_pathc
andgl_offs
staycint
, because then I would also need to duplicateposix.glob
andposix.globfree
. This basically means that every module that usescsize
anywhere in the exposed symbols needs to duplicate those symbols now with another version that usescsize_t
instead ofcsize
to fix the deprecationd and also stay backwards compatible.The alternative is to remerge #12321, but with a switch that allows
csize
to stay the old way.