4 ms·
ptrdiff_t is signed (because subtraction). size_t is unsigned (because length). This page is a much shorter summary than the article: http://www.gnu.org/softw
by seiji 11y ago
ptrdiff_t is signed (because subtraction). size_t is unsigned (because length).
This page is a much shorter summary than the article: http://www.gnu.org/software/libc/manual/html_node/Important-Data-Types.html http://www.gnu.org/software/libc/manual/html_node/Important-...
Also an important note: if you use special types like ptrdiff_t and size_t, you must not use the underlying native type printf specifiers when printing them. e.g. never print a ptrdiff_t using %ld, use the ptrdiff_t format specifier %td. (because some systems may say ptrdiff_t is long while others may say long long, and all your printf strings will then print compile time warnings.) Also see https://en.wikipedia.org/wiki/Printf_format_string#Length_field https://en.wikipedia.org/wiki/Printf_format_string#Length_fi...
Plus, the medium article is a complete copy/paste of this 2009 article: http://www.viva64.com/en/a/0050/ http://www.viva64.com/en/a/0050/ — looks like the account https://news.ycombinator.com/user?id=PVS-Studio https://news.ycombinator.com/user?id=PVS-Studio is copying from viva64 and posting to medium for a lot of old articles.
- w0000t 11y agoArticle republished by the author’s permission. I guess that is one way to write articles.
- gjm11 11y agoThe author of the original article is one Andrey Karpov. The Medium article is posted by someone called Sergey Vasiliev Marina Makarova and Andrey Karpov recommend". I guess it's the same Andrey Karpov in both cases, especially as hovering over the name Andrey Karpov on the Medium article indicates that his username is "Code_Analysis" and the original article was posted on the blog of a static-code-analysis company. Seems legit unless someone's actually impersonating someone else. I don't quite understand why, if Karpov wrote the original article and is a Medium contributor, Vasiliev rather than Karpov should be doing the reposting. (You could imagine something like this: K is a senior technical guy at PVS-Studio, V is a more junior technical guy or is in the marketing department; in 2009 they thought it better to post things under K's name to get it out there, but now K wants only the more impressive articles under his name and lets V post the others. But this doesn't feel terribly plausible.)
- AndreyKarpov 11y agoOMG! It is a great conspiracy theory! Everything is clear. Much time has elapsed since then, many people didn't read old articles about 64-bit. But these articles are useful and as we can see attract interest. Plus, the audience has changed. We would like to share with new one a good material. It is impossible to share old link that is why we decided republish some good articles in new places. This information will be interesting for recruits.