5 ms·
In general they appear to have a problem with mixing lengths between being ints and being size_ts (Decently common problem). In that particular instance they co
by DSMan195276 12y ago
In general they appear to have a problem with mixing lengths between being ints and being size_ts (Decently common problem). In that particular instance they could run into a problem if they compile for 64-bit (64-bit size_t, 32-bit int) and string_convert_ext gives a negative length, since int is signed.
- aktau 12y agoWe compile for 64-bit and 32-bit on every commit with travis CI and for many files activate extra warnings such as `-Wconversion`. We are acutely aware of the problem. However, we can't refactor the entirety of the (quite large) Vim codebase in one go. Whenever we add new code or replace old code that calls into more old code (often), we have to decide whether we will also refactor said old code to be more modern. In fact, we have sections of the projects wiki devoted to this type issue: https://github.com/neovim/neovim/wiki https://github.com/neovim/neovim/wiki (the specific section: https://github.com/neovim/neovim/wiki/Integer-types-refactoring-guidelines https://github.com/neovim/neovim/wiki/Integer-types-refactor...). It's not perfect, but you'll see we've put at least some thought into it and we welcome new contributions. It's a problem of manpower and/or time, not necessarily of misunderstanding C and making rookie mistakes about types as the grandparent seems to imply. There, had to get that off my chest. (I'm not seeing Neovim's code, old or new, is perfect, but it's probably better than what the tone of the comment implied).
- nate_meurer 12y agoaktau, your HN account appears to be dead. I'm guessing it's because this comment of yours was posted multiple times.
- aktau 12y agoThanks for the heads up. I went back and pressed submit several times because in my incognito window my comment didn't show up. (I was trying to post while noprocrast was on, didn't expect something I wrote to hit HN). I wonder now what I should do to not become dead anymore? I deleted the superfluous comments, hopefully that's enough. I'll look up what it means to be dead on HN.
- nate_meurer 12y agoDeleting those posts seems to have worked. I can now see your previously elided comments with my "showdead" set to on.
- dang 12y agoYour account is fine; it isn't and was never "dead". The system just kills duplicate comments.
- deleted 12y ago[deleted]
- deleted 12y ago[deleted]
- deleted 12y ago[deleted]
- billforsternz 12y agoJust posting to agree with the "decently common problem" comment. I am sure that back in the day I could write; int len = strlen( some_c_string ); Without getting a warning! I don't really need to be reminded that the random little strings I create in my code need to be less than 2 billion characters long!