{"id":353787,"date":"2024-05-20T22:35:12","date_gmt":"2024-05-20T22:35:12","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=353787"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=353787","title":{"rendered":"<span>\u041a\u0432\u0430! \u041a\u0430\u043a \u043f\u0438\u0441\u0430\u043b\u0438 \u043a\u043e\u0434 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0430 Quake<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u0414\u0436\u043e\u043d \u041a\u0430\u0440\u043c\u0430\u043a: &#171;\u0424\u043e\u043a\u0443\u0441 \u2014 \u044d\u0442\u043e \u0443\u043c\u0435\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043d\u0430 \u0447\u0442\u043e \u0432\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u0442\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f&#187;. \u0422\u0430\u043a \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e \u0438 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0430\u043d\u0430\u043b\u0438\u0437\u0443 \u043a\u043e\u0434\u0430 \u043b\u0435\u0433\u0435\u043d\u0434\u0430\u0440\u043d\u043e\u0439 Quake World.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/77c\/f96\/84f\/77cf9684fea0c73d547cb51833359965.png\" alt=\"1066_Quake_World_ru\/image1.png\" title=\"\" width=\"1600\" height=\"902\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/77c\/f96\/84f\/77cf9684fea0c73d547cb51833359965.png\"\/><\/figure>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044f \u043a\u043e\u0434 \u0447\u0443\u0436\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0442\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430 \u043c\u0435\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0441\u043b\u0443\u0436\u0430\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0434\u043b\u044f \u043a\u043e\u043b\u043b\u0435\u0433-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 \u0438 \u0441\u0435\u0431\u044f \u0441\u0430\u043c\u043e\u0433\u043e, \u043f\u0443\u0441\u043a\u0430\u0439 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e. \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u0434\u0430\u0436\u0435 \u0432\u044b\u0439\u0434\u0435\u0442 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u044c\u0438! \u041d\u043e, \u0431\u044b\u0432\u0430\u0435\u0442, \u0432 \u0440\u0443\u043a\u0438 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0447\u0442\u043e \u043f\u0430\u043b\u044c\u0446\u044b \u043d\u0430\u0434 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u043e\u0439 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0442\u0440\u044f\u0441\u0442\u0438\u0441\u044c \u043e\u0442 \u0432\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0438\u043a\u043e\u043d\u0430\u043c\u0438 \u0438\u043d\u0434\u0443\u0441\u0442\u0440\u0438\u0438, \u043e\u043d \u043d\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0438 \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u0448\u0430\u043d\u0441\u0430 \u2013 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0437\u0430 \u0434\u0435\u043b\u043e \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e!<\/p>\n<p>\u0414\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0430 \u044d\u0442\u0438\u0445 \u0441\u0442\u0440\u043e\u043a Quake \u2013 \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u041f\u0443\u0441\u043a\u0430\u0439 \u043d\u0435 \u043f\u0435\u0440\u0432\u0430\u044f \u0438\u0433\u0440\u0430 \u0432 &#171;\u043f\u043e\u043b\u043d\u043e\u043c&#187; 3D (\u043c\u044b \u0441 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435\u043c \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0432\u0430\u0441 \u043f\u043e\u0441\u043f\u043e\u0440\u0438\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043e Descent), \u043e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u0430 id Software \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437 \u0441\u0434\u0432\u0438\u043d\u0443\u0442\u044c \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u0437\u0430 \u0440\u0430\u043d\u0435\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u044b\u0435 \u043f\u0440\u0435\u0434\u0435\u043b\u044b.<\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u044f \u0441 \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c, \u043d\u0435 \u043c\u0443\u0434\u0440\u0435\u043d\u043e \u0438 \u0437\u0430\u0431\u044b\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u0441\u0434\u0435\u043b\u0430\u043d \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435 \u043b\u044e\u0434\u044c\u043c\u0438 (\u0445\u043e\u0442\u044f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u041a\u0430\u0440\u043c\u0430\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c\u043e\u0439, \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0434\u043b\u044f \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0439), \u0430 \u043b\u044e\u0434\u0438 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<p>\u0422\u0430\u043a \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043f\u043e\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0443 \u043b\u0443\u0447\u0448\u0438\u0445 \u0438\u0437 \u043d\u0430\u0441! \u041c\u044b \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0432\u0430\u0441 \u0432 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d Quake World!<\/p>\n<blockquote>\n<p>\u041f\u043e \u0445\u043e\u0434\u0443 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430. \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0432 \u043d\u0438\u0445, \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u043a\u0430\u043a PVS-Studio: \u0438\u043b\u0438 \/\/ &#8230; \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0430\u0432\u0442\u043e\u0440\u043e\u043c \u0441\u0442\u0430\u0442\u044c\u0438, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0436\u0435 \u2013 \u0447\u0430\u0441\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>\u0421\u0430\u043c\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/id-Software\/Quake\/tree\/master\/QW\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0413\u0438\u0442\u0445\u0430\u0431\u0435 id Software<\/a>.<\/p>\n<\/blockquote>\n<h3>\u041c\u0443\u043b\u044c\u0442\u0438\u0432\u0441\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u0431\u0435\u0437\u0443\u043c\u0438\u044f<\/h3>\n<p>\u0412\u0430\u043c \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0430 \u0434\u0435\u043d\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u044f\u043c\u043e \u043a\u0430\u043a \u0443 \u0414\u043e\u043a\u0442\u043e\u0440\u0430 \u0421\u0442\u0440\u0435\u043d\u0434\u0436\u0430? \u041f\u0440\u044b\u0433\u0430\u0442\u044c \u0442\u0443\u0434\u0430-\u0441\u044e\u0434\u0430 \u043c\u0435\u0436\u0434\u0443 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u0440\u0430\u0437\u0440\u0435\u0437\u0430\u0442\u044c \u0442\u043a\u0430\u043d\u044c \u0441\u0430\u043c\u043e\u0433\u043e \u043c\u0438\u0440\u043e\u0437\u0434\u0430\u043d\u0438\u044f? \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0437\u0432\u0430\u043b \u0443 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u043a\u043e\u0440\u043d\u043e\u0433\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void Mod_LoadTexinfo (lump_t *l) \/\/ PVS-Studio: client\/model.c  mtexinfo_t *out; \/\/ ...  for (j=0 ; j&lt;8 ; j++){     ut->vecs[0][j] = LittleFloat (in->vecs[0][j]); } <\/code><\/pre>\n<p>\u0411\u0435\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0435 \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: client\/model.c  typedef struct {     float       vecs[2][4]; \/\/ PVS-Studio: see what is wrong here?     float       mipadjust;     texture_t   *texture;     int         flags; } mtexinfo_t; <\/code><\/pre>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: client\/common.h  float (*LittleFloat) (float l); <\/code><\/pre>\n<p>\u041d\u0443, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u0431\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043a\u0430\u043a \u0441 \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c. &#171;\u0410 \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0433\u043e? \u041e\u043d \u0436\u0435 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0435\u0436\u0438\u0442 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438!&#187; \u2014 \u0441\u043a\u0430\u0436\u0435\u0442 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0430\u0432 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 C99, 6.2.5 Types p20:<\/p>\n<blockquote>\n<p>An array type describes a contiguously allocated nonempty set of objects with a particular member object type, called the element type. The element type shall be complete whenever the array type is specified.<\/p>\n<\/blockquote>\n<p>\u041d\u043e \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043c \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043d\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044e \u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0438 \u0432 \u044f\u0437\u044b\u043a\u0435 C \u0442\u0438\u043f\u0430 <a href=\"https:\/\/c-faq.com\/aryptr\/aryvsadr.html\">\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432 T<\/a>? \u0418\u0442\u0430\u043a, \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0447\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c, \u0434\u0435\u043b\u0430\u044f \u043f\u0435\u0440\u0432\u043e\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u043c\u0430\u0441\u0441\u0438\u0432\u0443?<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>[]<\/em> \u0432\u0435\u0440\u043d\u0451\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0438\u043f\u0430 <em>float[4]<\/em>. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a <em>j<\/em> \u043f\u0440\u0435\u0432\u044b\u0441\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 3, \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0447\u0442\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432\u043d\u0435 \u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0435\u043b\u043e\u0432, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f (UB).<\/p>\n<p>\u041e, \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u043c\u0438\u0440 UB! \u0412 \u0433\u043e\u043b\u043e\u0432\u0435 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u0434\u0435\u043b\u0430\u043b \u0446\u0438\u043a\u043b \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u0434\u043c\u0430\u0441\u0441\u0438\u0432\u0435, \u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0432\u0442\u043e\u0440\u043e\u0439 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u041d\u0435 \u0441\u0430\u043c\u043e\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0435, \u0447\u0442\u043e \u043c\u043e\u0433\u043b\u043e \u0431\u044b \u0441\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0432 \u043d\u0430\u0448\u0438\u0445 \u0438\u0433\u0440\u0430\u0445, \u043d\u043e \u0437\u0430\u0447\u0435\u043c \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438 \u044d\u0442\u043e!<\/p>\n<p>\u0421\u0430\u043c\u044b\u043c \u0441\u043a\u0435\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c (\u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c) \u043c\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u043f\u0443\u043d\u043a\u0442\u043e\u0432 6.5.2.1\/2 \u0438 6.5.6\/8 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 \u042199:<\/p>\n<details class=\"spoiler\">\n<summary>\u041d\u0430\u0436\u043c\u0438 \u043c\u0435\u043d\u044f:<\/summary>\n<div class=\"spoiler__content\">\n<p> C99, 6\\.5\\.2\\.1\/2: <\/p>\n<p>A postfix expression followed by an expression in square brackets [] is a subscripted designation of an element of an array object. The definition of the subscript operator [] is that E1[E2] is identical to (*((E1)+(E2))). Because of the conversion rules that apply to the binary + operator, if E1 is an array object (equivalently, a pointer to the initial element of an array object) and E2 is an integer, E1[E2] designates the E2-th element of E1 (counting from zero).<\/p>\n<p>C99, 6.5.6\/8:<\/p>\n<p>When an expression that has integer type is added to or subtracted from a pointer, the result has the type of the pointer operand. If the pointer operand points to an element of an array object, and the array is large enough, the result points to an element offset from the original element such that the difference of the subscripts of the resulting and original array elements equals the integer expression. In other words, if the expression P points to the i-th element of an array object, the expressions (P)+N (equivalently, N+(P)) and (P)-N (where N has the value n) point to, respectively, the i+n-th and i\u2212n-th elements of the array object, provided they exist. Moreover, if the expression P points to the last element of an array object, the expression (P)+1 points one past the last element of the array object, and if the expression Q points one past the last element of an array object, the expression (Q)-1 points to the last element of the array object. If both the pointer operand and the result point to elements of the same array object, or one past the last element of the array object, the evaluation shall not produce an overflow; otherwise, the behavior is undefined. If the result points one past the last element of the array object, it shall not be used as the operand of a unary * operator that is evaluated.<\/p>\n<\/div>\n<\/details>\n<p>\u041e \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u0447\u0430\u0441\u0430\u043c\u0438. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 \u0441\u043a\u043e\u0440\u0435\u0435 \u043f\u043e\u0445\u0432\u0430\u043b\u044c\u043d\u043e, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0441\u0442\u0440\u0430\u0434\u0430\u0435\u0442. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u0442 \u0432\u0430\u0448 \u0434\u0438\u0441\u043a, \u043d\u043e <a href=\"https:\/\/randomascii.wordpress.com\/2014\/05\/19\/undefined-behavior-can-format-your-drive\/\">\u0437\u0430\u0447\u0435\u043c \u0440\u0438\u0441\u043a\u043e\u0432\u0430\u0442\u044c<\/a>?<\/p>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u0442\u043e \u043e\u043d \u0432\u044b\u0434\u0430\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u043e\u0435:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v557\/\"><strong>V557<\/strong><\/a><strong> Array overrun is possible. The value of &#8216;j&#8217; index could reach 7.<\/strong><\/p>\n<p><em>P.S. \u0427\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u0431\u044b \u043f\u0440\u0438\u0437\u043d\u0430\u044e\u0442 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u043a\u0438 \u0438 \u0434\u0430\u0436\u0435 \u0434\u0435\u043b\u0430\u044e\u0442 \u0441\u043e\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/em><\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void Mod_LoadTexinfo (lump_t *l) \/\/ PVS-Studio: server\/model.c  #if 0     for (j=0 ; j&lt;8 ; j++)         out->vecs[0][j] = LittleFloat (in->vecs[0][j]);     len1 = Length (in->vecs[0]);     len2 = Length (in->vecs[1]); #else     for (j=0 ; j&lt;4 ; j++) {         out->vecs[0][j] = LittleFloat (in->vecs[0][j]);         out->vecs[1][j] = LittleFloat (in->vecs[1][j]);     }     len1 = Length (out->vecs[0]);     len2 = Length (out->vecs[1]); #endif <\/code><\/pre>\n<h3>\u041d\u0435 \u0433\u0440\u043e\u0437\u0438 \u043c\u0435\u0441\u0442\u043d\u043e\u043c\u0443 \u0431\u0430\u0440\u0443, \u043f\u043e\u043f\u0438\u0432\u0430\u044f \u0431\u043e\u0440\u0436\u043e\u043c\u0438 \u0432 \u0441\u0430\u043d\u0430\u0442\u043e\u0440\u0438\u0438<\/h3>\n<p>\u041c\u044b \u0431\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0435\u0440\u0435\u0447\u044c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439, \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0447\u0443\u0442\u043a\u043e \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0445\u0441\u044f \u043a \u043b\u0443\u0447\u0448\u0438\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430\u043c: \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441!<\/p>\n<p>\u0410 \u0432\u044b, \u0445\u0440\u0430\u0431\u0440\u0435\u0446, \u0443\u0437\u0440\u0438\u0442\u0435!<\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void Sys_Printf (char *fmt, ...) \/\/ PVS-Studio: client\/sys_linux.c, server\/sys_linux.c  char text[2048];  va_start (argptr,fmt); vsprintf (text,fmt,argptr); va_end (argptr);  if (strlen(text) > sizeof(text))     Sys_Error(\"memory overwrite in Sys_Printf\"); <\/code><\/pre>\n<p>\u0411\u044b\u0442\u044c \u0432 \u043a\u0443\u0440\u0441\u0435, \u043a\u043e\u0433\u0434\u0430 \u0447\u0442\u043e-\u0442\u043e \u0438\u0434\u0451\u0442 \u043d\u0435 \u0442\u0430\u043a, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0438 \u0434\u0430\u0436\u0435 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u0430\u043a \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0448\u043b\u043e \u0432\u043e\u0432\u0441\u0435. \u041f\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0435\u0431\u044f \u043d\u0430 \u043c\u0435\u0441\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u2013 \u043a\u0430\u043a \u0431\u0435\u0434\u043e\u043b\u0430\u0433\u0435 \u0436\u0438\u0442\u044c \u0441 \u043c\u044b\u0441\u043b\u044c\u044e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e <em>\u0434\u043b\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043b\u0438\u043d\u043d\u0435\u0435, \u0447\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044d\u0442\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f<\/em>? \u0412\u043e\u0442 \u0438 \u0430\u0432\u0442\u043e\u0440 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430 \u0435\u0433\u043e \u043c\u0435\u0441\u0442\u0435 \u0431\u044b \u043d\u0435 \u0441\u043c\u043e\u0433 \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u0432\u0435\u0434\u044c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u043d\u0435 \u0440\u0430\u043c\u043e\u043a \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438 \u0440\u0430\u043d\u0435\u0435, \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0447\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435. \u0418 \u0432\u043e\u0442 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u043b\u0435\u0435 \u2013 \u0432\u0435\u0440\u044f, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432 \u0440\u0435\u043b\u0438\u0437\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0432\u043e\u0432\u0441\u0435 \u0443\u0431\u0435\u0440\u0451\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435, <em>vsprintf<\/em> \u0438\u0441\u043f\u043e\u0440\u0442\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0432 \u0437\u0430\u0442\u044f\u0436\u043d\u043e\u0435 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0435 \u043f\u043e \u0432\u044b\u0434\u0430\u0447\u0435 \u0432 \u043e\u043a\u043e\u0448\u043a\u0435 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a\u0430. \u0418 \u043f\u043e\u0434\u0435\u043b\u043e\u043c!<\/p>\n<p>\u041d\u0430\u0448 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440, \u043e\u0442\u043e\u0439\u0434\u044f \u043e\u0442 \u0448\u043e\u043a\u0430, \u0432\u044b\u0434\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\"><strong>V547<\/strong><\/a><strong> Expression &#8216;strlen(text) > sizeof (text)&#8217; is always false.<\/strong><\/p>\n<p>\u042d\u0442\u043e \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u043b\u0438\u0441\u044c \u0437\u0430\u043f\u043e\u0437\u0434\u0430\u043b\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void Info_SetValueForStarKey (\/* ... *\/) \/\/ PVS-Studio: client\/common.c  if (strstr (key, \"\\\\\") || strstr (value, \"\\\\\") ) {     Con_Printf (\"Can't use keys or values with a \\\\\\n\");     return; } <\/code><\/pre>\n<p>\u041f\u043e\u043a\u0430 \u0447\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u0434\u0430\u0436\u0435 \u043d\u0435\u043f\u043b\u043e\u0445\u043e, \u043d\u043e \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u0447\u0438\u0442\u0430\u0435\u043c \u0447\u0443\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435:<\/p>\n<pre><code class=\"cpp\">if (!value || !strlen(value))     return; <\/code><\/pre>\n<p>\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u2013 \u0441\u0440\u043e\u0434\u043d\u0438 \u0434\u043e\u0431\u0440\u043e\u0434\u0435\u0442\u0435\u043b\u0438, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0430 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0432\u0440\u0435\u043c\u044f. \u041d\u0430\u0448 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u0433\u043b\u0430\u0441\u0435\u043d \u0441 \u0442\u0430\u043a\u0438\u043c \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v595\/\"><strong>V595<\/strong><\/a><strong> The &#8216;value&#8217; pointer was utilized before it was verified against nullptr.<\/strong><\/p>\n<h3>\u0427\u0435\u043c \u044d\u0442\u043e \u043f\u043e\u043f\u0430\u0445\u0438\u0432\u0430\u0435\u0442?<\/h3>\n<p>\u0410 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: client\/d_sprite.c  static sspan_t  *sprite_spans;  void D_DrawSprite (void) {     sspan_t     spans[MAXHEIGHT+1];     sprite_spans = spans; \/\/ PVS-Studio: are you dead sure?     \/\/ ...     D_SpriteScanLeftEdge ();     D_SpriteScanRightEdge ();     D_SpriteDrawSpans (sprite_spans); }  void D_SpriteScanLeftEdge (void) {     pspan = sprite_spans;     \/\/ ... }  void D_SpriteScanRightEdge (void) {     pspan = sprite_spans;     \/\/ ... }  void D_SpriteDrawSpans (sspan_t *pspan) {     \/\/ PVS-Studio: pspan is used, among other things } <\/code><\/pre>\n<p>\u0410\u0432\u0442\u043e\u0440 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u043c\u043d\u0438\u0442 \u0441\u0430\u043c\u044b\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u043e\u0432\u0435\u0442 \u0438\u0437 \u0441\u0430\u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u043e\u0439 \u043a\u043d\u0438\u0436\u043a\u0438 \u043f\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0438\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0439 \u2013 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u043e\u043e\u0431\u0449\u0435! \u0424\u0443\u043d\u043a\u0446\u0438\u0438, \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0442\u0430\u043a\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0442\u0440\u0443\u0434\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c. \u041a\u0430\u043a \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u043e\u043d\u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u043d\u0435\u0440\u0435\u0435\u043d\u0442\u0440\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0432\u0440\u0430\u0442\u0430 \u0432 \u0430\u0434 (\u0438\u0437\u0432\u0438\u043d\u0438\u0442\u0435, <a href=\"https:\/\/www.gamedev.net\/articles\/programming\/general-and-gameplay-programming\/analyzing-doom-3-code-with-pvs-studio-r4293\/\">\u043e\u0448\u0438\u0431\u0441\u044f \u0438\u0433\u0440\u043e\u0439<\/a>).<\/p>\n<p>\u041d\u0443 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0431\u044b\u043b\u043e \u0442\u0430\u043a\u043e\u0435, \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c, \u0447\u0442\u043e \u0432\u044b \u0437\u0430\u0431\u044b\u0432\u0430\u043b\u0438 \u043f\u0440\u043e \u043c\u0435\u0441\u0442\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435? \u0423\u0436\u0435 \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u043e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 <em>\u0432\u043e\u043d \u0442\u043e\u0442 \u043d\u043e\u0432\u0435\u043d\u044c\u043a\u0438\u0439<\/em> \u0438\u0437 \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u0441\u0442\u0432\u0430 \u043d\u0430\u0440\u0443\u0448\u0430\u043b \u0441\u0432\u044f\u0449\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u043e \u0432\u044b\u0437\u043e\u0432\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>\u0410<\/em> \u0421\u0422\u0420\u041e\u0413\u041e \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>\u0411<\/em>?<\/p>\n<p>\u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435\u0441\u044c \u043a \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2013 \u0435\u0441\u0442\u044c \u043b\u0438 \u0442\u0430\u043c \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0438\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u043b\u043e\u0441\u0447\u0430\u0441\u0442\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439?<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v507\/\"><strong>V507<\/strong><\/a><strong> Pointer to local array &#8216;spans&#8217; is stored outside the scope of this array. Such a pointer will become invalid.<\/strong><\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u043d\u0430\u0448 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043f\u0430\u0445\u0438\u0432\u0430\u0435\u0442, \u0430 \u043d\u0435 \u043b\u043e\u043c\u0430\u0435\u0442 \u0438\u0433\u0440\u0443. \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u043d\u0438\u0436\u0435 \u043f\u043e \u0441\u0442\u0435\u043a\u0443 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e. \u041d\u043e \u043e\u0434\u0438\u043d \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0448\u0430\u0436\u043e\u043a \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u2013 \u0438 \u0433\u043e\u0442\u043e\u0432\u044c\u0442\u0435\u0441\u044c \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0430\u0447\u043d\u0451\u0442 \u0434\u0435\u043c\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u0442\u043e\u0440\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u0417\u0435\u043c\u043b\u044e. \u0427\u0442\u043e \u0435\u043c\u0443 \u043f\u043e\u043c\u0435\u0448\u0430\u0435\u0442: \u044d\u0442\u043e, \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432, \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435!<\/p>\n<p><em>P.S. \u0417\u0430\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u043e\u0434\u043d\u0430 \u0438\u0437 \u0442\u0440\u0451\u0445 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u044d\u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432, \u043d\u0435 \u0438\u043c\u0435\u044f \u0434\u0435\u043b\u043e \u0441 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e sprite_spans \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u044d\u0442\u043e\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435, \u0442\u0430\u043a\u043e\u0435 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0435 \u0432 \u0432\u044b\u0437\u043e\u0432\u0430\u0445 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u2013 \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u043e \u0432\u0441\u0435 \u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438?<\/em><\/p>\n<h3>\u0412\u0435\u043b\u0438\u043a\u0438\u0439 \u0443\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u043e\u0439:<\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void CDAudio_Play(byte track, qboolean looping) \/\/ PVS-Studio: client\/cd_linux.c, client\/cd_win.c  if (cdvolume == 0.0)     CDAudio_Pause ();  static float    cdvolume; <\/code><\/pre>\n<p>\u0418\u043b\u0438 \u0442\u0430\u043a\u043e\u0439:<\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void CDAudio_Update(void) \/\/ PVS-Studio: client\/cd_linux.c, client\/cd_win.c  if (bgmvolume.value != cdvolume) {     if (cdvolume)     \/\/ ... } <\/code><\/pre>\n<p>\u0418, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0442\u043d\u044b\u0445 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: static qboolean Cam_IsVisible(player_state_t *player, vec3_t vec) \/\/ PVS-Studio: client\/cl_cam.c  if (trace.fraction != 1 || trace.inwater)     return 9999; typedef struct {     float       fraction;       \/\/ time completed, 1.0 = didn't hit anything     \/\/ ... } pmtrace_t; <\/code><\/pre>\n<p>\u041f\u043e\u0434\u043d\u0438\u043c\u0438\u0442\u0435 \u0440\u0443\u043a\u0443 \u0442\u0435, \u043a\u0442\u043e \u0438\u043c\u0435\u043b \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435 (\u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0430 \u0441\u0430\u0440\u043a\u0430\u0437\u043c \u043f\u0440\u0438\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f) \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438, \u0432\u044b\u0437\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f\u043c\u0438. \u041d\u0435 \u0432\u0441\u0435 \u0447\u0438\u0441\u043b\u0430 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u043c \u043a\u043e\u0434\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u0439 \u043a \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u043c\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043d\u0435 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c. \u0417\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u0442\u0430\u043a\u0438\u0445 \u0447\u0438\u0441\u0435\u043b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0442\u043e\u0447\u043d\u044b \u0438 \u0432 \u0445\u0443\u0434\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\u044b \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0435 \u043a\u043e\u0434\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b.<\/p>\n<p>\u0414\u043b\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0442\u0435\u0445\u043d\u0438\u043a\u0438, \u0432\u0440\u043e\u0434\u0435 absolute difference checks, edit distance checks, relative distance checks (\u0441\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/beta.boost.org\/doc\/libs\/1_68_0\/libs\/math\/doc\/html\/math_toolkit\/float_comparison.html\">\u0442\u0443\u0442<\/a> \u0438 <a href=\"https:\/\/bitbashing.io\/comparing-floats.html\">\u0442\u0443\u0442<\/a>), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u041d\u0430\u0448 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u043d\u043e\u0441\u0438\u0442 \u0441\u0432\u043e\u044e \u043b\u0435\u043f\u0442\u0443 \u0432 \u0434\u0435\u043b\u043e \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u0440\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v550\/\"><strong>V550<\/strong><\/a><strong> An odd precise comparison. It&#8217;s probably better to use a comparison with defined precision: fabs(&#8230;) > Epsilon.<\/strong><\/p>\n<p>\u041d\u043e \u043f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435, \u0443 \u043d\u0430\u0441 \u043f\u0440\u0438\u043f\u0430\u0441\u0451\u043d \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0441\u043d\u043e\u0431\u043e\u0432 (\u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0430\u0432\u0442\u043e\u0440 \u0441\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u0438\u043c\u0435\u0435\u0442 \u0447\u0435\u0441\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0438 \u0441\u0435\u0431\u044f). \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0445\u043e\u0434\u0443, \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u0434\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void CL_Record_f (void) \/\/ PVS-Studio: client\/cl_demo.c  entity_state_t *es, blankes; \/\/ ... if (memcmp(es, &amp;blankes, sizeof(blankes))) {     \/\/ ... } <\/code><\/pre>\n<p>&#171;\u0422\u0430\u043a \u0432\u0435\u0434\u044c \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f!&#187; \u2013 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0430\u0434\u043f\u0438\u0441\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u0437\u043d\u0430\u0435\u043c!<\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: client\/protocol.h  typedef struct {     int     number;         \/\/ edict index     int     flags;          \/\/ nolerp, etc     vec3_t  origin;     vec3_t  angles;     int     modelindex;     int     frame;     int     colormap;     int     skinnum;     int     effects; } entity_state_t; <\/code><\/pre>\n<p>\u041a\u0443\u0447\u043a\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 <em>int<\/em> \u0438 \u043f\u0430\u0440\u0430 \u0437\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u044b\u0445 <em>vec3_t<\/em>. \u0412\u0435\u0434\u0451\u043c \u0440\u0430\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043b\u044c\u0448\u0435:<\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: client\/mathlib.h  typedef float vec_t; typedef vec_t vec3_t[3]; typedef vec_t vec5_t[5]; <\/code><\/pre>\n<p>\u041f\u043e\u043d\u044f\u0442\u043d\u043e, <em>memcmp<\/em> \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u0430 <em>float<\/em>. \u041d\u0435 \u043b\u0443\u0447\u0448\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u043f\u043e \u043c\u0435\u0440\u043a\u0430\u043c \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, SEI CERT \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442 \u0432\u043e\u0437\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u044d\u0442\u043e\u0433\u043e (\u0441\u043c\u043e\u0442\u0440\u0438 \u0432 <a href=\"https:\/\/wiki.sei.cmu.edu\/confluence\/display\/c\/FLP37-C.+Do+not+use+object+representations+to+compare+floating-point+values\">FLP37-C. Do not use object representations to compare floating-point values<\/a>). \u0414\u0430\u0436\u0435 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0435\u0431\u0435\u0437\u044b\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e IEEE 754 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u0440\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u043d\u0443\u043b\u0435\u0439 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u043a\u0430\u043c\u0438 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c NaN. \u041d\u043e, \u0441\u0442\u0440\u043e\u0433\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u044f\u0437\u044b\u043a\u0430 C \u0438 \u043d\u0435 \u043f\u0440\u0438\u043d\u0443\u0436\u0434\u0430\u0435\u0442 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e IEEE 754 \u0432\u043e\u0432\u0441\u0435 (\u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u0435\u0441\u043b\u0438 \u0432\u044b, \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c, \u043a\u043e\u0433\u0434\u0430-\u043b\u0438\u0431\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043c\u0430\u0448\u0438\u043d\u0435 \u0441 \u0438\u043d\u044b\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0442\u0430\u043a\u0438\u0445 \u0447\u0438\u0441\u0435\u043b, \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u0435 \u043d\u0430\u043c \u043e\u0431 \u044d\u0442\u043e\u043c!).<\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0436\u0435, \u0435\u0441\u043b\u0438 \u0432 \u0432\u0430\u0448\u0435\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u0442\u0440\u043e\u0433\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439, \u043d\u0430\u0448 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435\u043c:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1014\/\"><strong>V1014<\/strong><\/a><strong> Structures with members of real type are compared byte-wise.<\/strong><\/p>\n<p><em>P.S. \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u0443\u044e\u0442 \u0431\u0430\u0439\u0442\u0430\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439, \u0430\u0432\u0442\u043e\u0440 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u044f \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u043b\u044e\u0441\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 memcmp.<\/em><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9ac\/f34\/c3b\/9acf34c3bfd442904bd68f02be82089b.png\" alt=\"1066_Quake_World_ru\/image2.png\" title=\"\" width=\"1600\" height=\"902\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9ac\/f34\/c3b\/9acf34c3bfd442904bd68f02be82089b.png\"\/><\/figure>\n<h3>\u041f\u0440\u043e\u0447\u0438\u0435 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u0430\u0448 \u043f\u043e\u043a\u043e\u0440\u043d\u044b\u0439 \u043d\u0435 \u0443\u0434\u043e\u0441\u0443\u0436\u0438\u043b\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435. \u041f\u0443\u0441\u043a\u0430\u0439 \u0438 \u0431\u0435\u0437\u044b\u043c\u044f\u043d\u043d\u044b\u0435, \u043e\u043d\u0438 \u0432\u0441\u0451 \u0436\u0435 \u043d\u0435\u0441\u0443\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u044f (\u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430, \u0430 \u043d\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0430 \u0438\u0445 \u0432 \u043d\u0451\u043c!). \u0412\u043e\u0442 \u044d\u0442\u0438 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b:<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 1<\/strong><\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void COM_AddGameDirectory (char *dir) \/\/ PVS-Studio: client\/common.c  char *p;    if ((p = strrchr(dir, '\/')) != NULL)     strcpy(gamedirfile, ++p); else     strcpy(gamedirfile, p); <\/code><\/pre>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u0435\u043b\u0430\u044e\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 <em>NULL<\/em>, \u043e\u043d\u0438 \u0432\u0441\u0451 \u0436\u0435 \u043d\u0435 \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u044e\u0442 \u043d\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0435\u043c\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0432\u0435\u043d. \u0417\u0430\u0447\u0435\u043c \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u2013 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043a\u0430\u043a \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v575\/\"><strong>V575<\/strong><\/a><strong> The null pointer is passed into &#8216;strcpy&#8217; function. Inspect the second argument.<\/strong><\/p>\n<p><em>P.S. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432 else \u0432\u0435\u0442\u043a\u0435 \u0432\u0442\u043e\u0440\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 strcpy \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u043b\u0430 \u0441\u0442\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f dir, \u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0441\u043b\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430.<\/em><\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 2<\/strong><\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void Draw_ConsoleBackground (int lines) \/\/ PVS-Studio: client\/draw.c  qpic_t      *conback; \/\/ ... dest = conback->data + 320 + 320*186 - 11 - 8*strlen(ver); <\/code><\/pre>\n<pre><code class=\"cpp\"> \/\/ PVS-Studio: client\/wad.h  typedef struct {     int         width, height;     byte        data[4];            \/\/ variably sized } qpic_t; <\/code><\/pre>\n<p>\u0427\u0451\u0440\u043d\u0430\u044f \u043c\u0430\u0433\u0438\u044f \u043d\u044b\u043d\u0447\u0435 \u0432\u043d\u0435 \u0437\u0430\u043a\u043e\u043d\u0430, \u043d\u043e \u0440\u0430\u043d\u044c\u0448\u0435, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u0441\u0442\u0430\u0440\u043e\u0436\u0438\u043b\u044b, \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <em>flexible arrays<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0442.\u043d. &#171;struct hack&#187;. \u042d\u0442\u0430 \u0438\u0434\u0438\u043e\u043c\u0430 \u0438 \u0442\u043e\u0433\u0434\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0445\u043e\u0442\u044f \u0438 \u0437\u0430\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043b\u0430 \u0441\u0435\u0431\u044f \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u2013 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0451 \u043e\u0431\u043b\u0430\u0433\u043e\u0440\u043e\u0434\u0438\u043b\u0438 \u0432 C99 (\u0441\u043c\u043e\u0442\u0440\u0438 \u043f\u0430\u0440. 6.7.2.1 \u0432 <a href=\"https:\/\/www.open-std.org\/jtc1\/sc22\/wg14\/www\/C99RationaleV5.10.pdf\">\u044d\u0442\u043e\u043c \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438<\/a>). \u041f\u043e\u044f\u0432\u0438\u0432\u0448\u0438\u0441\u044c \u0443\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Quake, \u044d\u0442\u0430 \u0444\u0438\u0447\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0443\u0447\u0448\u0435\u0439 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043e\u0439 (\u0441\u043c., \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, <a href=\"https:\/\/www.youtube.com\/watch?v=nrojq96szcA\">\u0434\u043e\u043a\u043b\u0430\u0434 \u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u044f\u0434\u0440\u0430 \u041b\u0438\u043d\u0443\u043a\u0441<\/a>) \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043e\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v594\/\"><strong>V594<\/strong><\/a><strong> The &#8216;conback->data + 320&#8217; pointer steps out of array&#8217;s bounds.<\/strong><\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 3<\/strong><\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void CL_AddFlagModels (entity_t *ent, int team) \/\/ PVS-Studio: client\/cl_ents.cif   if (ent->frame >= 103 &amp;&amp; ent->frame &lt;= 104) f = f + 6;   \/\/nailattack   else if (ent->frame >= 105 &amp;&amp; ent->frame &lt;= 106) f = f + 6;  \/\/light   else if (ent->frame >= 107 &amp;&amp; ent->frame &lt;= 112) f = f + 7;  \/\/rocketattack   else if (ent->frame >= 112 &amp;&amp; ent->frame &lt;= 118) f = f + 7;  \/\/shotattack } <\/code><\/pre>\n<p>\u0413\u043e\u0432\u043e\u0440\u044f\u0442, \u044f\u0432\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u0445 \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a, \u043a\u0430\u043a \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 (\u0441\u0440\u0430\u0437\u0443 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0442\u044f\u0436\u0435\u043b\u043e, \u043e\u0442\u0432\u0435\u0442 \u2013 112). \u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v695\/\"><strong>V695<\/strong><\/a><strong> Range intersections are possible within conditional expressions. Example: if (A > 0 &amp;&amp; A &lt; 5) { &#8230; } else if (A > 3 &amp;&amp; A &lt; 9) { &#8230; }.<\/strong><\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 4<\/strong><\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: float CL_KeyState (kbutton_t *key) \/\/ PVS-Studio: client\/cl_input.c  if (impulseup &amp;&amp; !impulsedown)     if (down)         val = 0;    \/\/ I_Error ();     else         val = 0;    \/\/ released this frame <\/code><\/pre>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u044f\u0432\u043d\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043b\u0438 \u0442\u0430\u043c \u0438\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u2013 \u0437\u0430\u0433\u0430\u0434\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0440\u0435\u0448\u0430\u0435\u0442 \u0442\u0430\u043a:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v523\/\"><strong>V523<\/strong><\/a><strong> The &#8216;then&#8217; statement is equivalent to the &#8216;else&#8217; statement.<\/strong><\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 5<\/strong><\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void Key_Bind_f (void) \/\/ PVS-Studio: client\/keys.c  cmd[0] = 0;     \/\/ start out with a null string for (i=2 ; i&lt; c ; i++) {     strcat (cmd, Cmd_Argv(i));     if (i != (c-1))         strcat (cmd, \" \"); } <\/code><\/pre>\n<p>\u0410 \u0442\u0443\u0442-\u0442\u043e \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a? \u0413\u043e\u0432\u043e\u0440\u044f \u043e\u0442\u043a\u0440\u043e\u0432\u0435\u043d\u043d\u043e, \u0430\u0432\u0442\u043e\u0440 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0442\u0435\u0440\u044f\u043b \u0432\u0435\u0440\u0443 \u0432 \u0435\u0434\u0438\u043d\u043e\u0440\u043e\u0433\u043e\u0432 (\u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0432 <a href=\"https:\/\/habr.com\/ru\/companies\/pvs-studio\/articles\/567312\/\">\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e<\/a>), \u043f\u043e\u043a\u0430 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435. \u0414\u044c\u044f\u0432\u043e\u043b, \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u0432 \u0434\u0435\u0442\u0430\u043b\u044f\u0445, \u0438\u043b\u0438, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432 \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u043a\u043e\u0434\u0435:<\/p>\n<pre><code class=\"cpp\">if (c != 2 &amp;&amp; c != 3) {     Con_Printf (\"bind &lt;key> [command] : attach a command to a key\\n\");     return; } if (c == 2) {     \/\/ ...     return; } <\/code><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u0446\u0438\u043a\u043b \u043d\u0435 \u043f\u043e\u0439\u0434\u0451\u0442 \u0434\u0430\u043b\u044c\u0448\u0435 3-\u0445, \u0434\u0430? \u0422\u043e \u0435\u0441\u0442\u044c \u043e\u043d \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0434\u0430?  \u0422\u043e \u0435\u0441\u0442\u044c \u0438 \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u0432\u044b\u0447\u0438\u0441\u0442\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437. \u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043e\u0448\u0438\u0431\u043a\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u043d\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0435:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\"><strong>V547<\/strong><\/a><strong> Expression &#8216;i != (c &#8212; 1)&#8217; is always false.<\/strong><\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 6<\/strong><\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: int Sbar_ColorForMap (int m) \/\/ PVS-Studio: client\/sbar.c  return m &lt; 128 ? m + 8 : m + 8; <\/code><\/pre>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0445\u043e\u0442\u0435\u043b\u0438 \u0434\u043e\u043d\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u0438 \u043c\u044b\u0441\u043b\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0430, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043c\u0435\u043b\u0438 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443 \u0447\u0443\u0432\u0441\u0442\u0432\u043e \u044e\u043c\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v583\/\"><strong>V583<\/strong><\/a><strong> The &#8216;?:&#8217; operator, regardless of its conditional expression, always returns one and the same value.<\/strong><\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 7<\/strong><\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void CL_StartUpload (byte *data, int size) \/\/ PVS-Studio: client\/cl_parse.c  upload_data = malloc(size); memcpy(upload_data, data, size); <\/code><\/pre>\n<p>\u041d\u0438\u0447\u0442\u043e \u043d\u0435 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442 \u043d\u0430\u0441 \u043c\u043e\u043b\u0447\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0432\u043e\u0437\u0440\u0430\u0449\u0451\u043d\u043d\u043e\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <em>malloc<\/em>, \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f! \u041e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u0437\u0430\u043c\u0435\u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e \u043a \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e\u043b\u043e\u0436\u0438\u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043d\u0430 \u043b\u043e\u043f\u0430\u0442\u043a\u0438. \u041a\u0430\u043a \u0432\u0430\u043c \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0430 \u0438\u0441\u043f\u043e\u0440\u0442\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u2013 \u043a <em>NULL<\/em> \u0436\u0435 \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u0438\u0431\u0430\u0432\u0438\u0442\u044c, \u0430 \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u043c\u0443\u0441\u044f \u0430\u0434\u0440\u0435\u0441\u0443! \u0414\u0430\u0436\u0435 <em>memcpy<\/em>, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u043c\u043e\u0436\u0435\u0442 \u0443\u0441\u043f\u0435\u0442\u044c \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, (\u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043a\u043e\u043d\u0446\u0430 \u0443\u0447\u0430\u0441\u0442\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438) \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u043e\u0431 \u044d\u0442\u043e\u043c <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0938\/\">\u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e<\/a>, \u0430 \u043c\u044b \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437 \u043f\u043e\u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0437\u0430 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v575\/\"><strong>V575<\/strong><\/a><strong> The potential null pointer is passed into &#8216;memcpy&#8217; function. Inspect the first argument.<\/strong><\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 8<\/strong><\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void CL_ParseBeam (model_t *m) \/\/ PVS-Studio: client\/cl_tent.c  if (b->entity == ent) {     b->entity = ent;     \/\/ ... } <\/code><\/pre>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void Sbar_SortTeams (void) \/\/ PVS-Studio: client\/sbar.c  if (j == scoreboardteams) { \/\/ must add him     j = scoreboardteams++; <\/code><\/pre>\n<p>\u0412\u044b\u0448\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0434\u0432\u0430 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0441\u043e \u0441\u0445\u043e\u0436\u0438\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435\u043c. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u2013 \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u0432\u0430\u043b \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0438 \u0434\u0432\u0443\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430. \u0412\u043f\u043e\u043b\u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043b\u044e\u0441\u0438\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u0441\u0442\u043e\u044f\u0442\u044c \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0438\u043c\u0435\u043d\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v1048\/\"><strong>V1048<\/strong><\/a><strong> The variable was assigned the same value.<\/strong><\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 9<\/strong><\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void Info_SetValueForStarKey (\/* ... *\/) \/\/ PVS-Studio: client\/common.c  c &amp;= 127; if (c &lt; 32 || c > 127)     continue; <\/code><\/pre>\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u043a\u0430\u043a\u0438\u0435 \u0442\u0435\u0445\u043d\u0438\u043a\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0432\u044b\u0448\u0435 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u2013 \u0430 \u0437\u0430\u0447\u0435\u043c \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e? \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u0433\u043b\u0430\u0441\u0435\u043d \u0441 \u043d\u0430\u043c\u0438 \u0432 \u044d\u0442\u043e\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0435:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v560\/\"><strong>V560<\/strong><\/a><strong> A part of conditional expression is always false: c > 127.<\/strong><\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 10<\/strong><\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void M_Keys_Key (int k) \/\/ PVS-Studio: client\/menu.c  if (bind_grab) {       \/\/ ...     if (k == K_ESCAPE)     {         bind_grab = false;     }     else if (k != '`')     {         \/\/ ...     }     bind_grab = false; } <\/code><\/pre>\n<p>\u041a\u0430\u043a \u043f\u0435\u043b\u043e\u0441\u044c \u0432 \u0437\u043d\u0430\u043c\u0435\u043d\u0438\u0442\u043e\u0439 \u043f\u0435\u0441\u043d\u0435 \u0433\u0440\u0443\u043f\u043f\u044b Linkin Park \u2014 <em>in the end it doesn&#8217;t even matter<\/em>. \u041d\u0435 \u0441\u0430\u043c\u0430\u044f \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u0434\u0435\u043b\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 C, \u043d\u043e \u0437\u0430\u0447\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u0435\u0451, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v519\/\"><strong>V519<\/strong><\/a><strong> The &#8216;bind_grab&#8217; variable is assigned values twice successively. Perhaps this is a mistake.<\/strong><\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 11<\/strong><\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: client\/r_edge.c  edge_t  edge_sentinel;  \/\/ PVS-Studio: void R_ScanEdges (void) \/\/ PVS-Studio: client\/r_edge.c  \/\/ FIXME: do we need this now that we clamp x in r_draw.c? edge_sentinel.u = 2000 &lt;&lt; 24;       \/\/ make sure nothing sorts past this <\/code><\/pre>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: client\/r_shared.h  \/\/ !!! if this is changed, it must be changed in asm_draw.h too !!! typedef struct edge_s {     fixed16_t       u;     \/\/ ... } edge_t; <\/code><\/pre>\n<p>\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u0441\u0430\u043c\u0438 \u0437\u0430 \u0441\u0435\u0431\u044f, \u043d\u043e \u0432\u0441\u0451 \u0436\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043f\u043e\u043a\u0440\u044b\u0442 \u0442\u0430\u0439\u043d\u043e\u0439. \u0421\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435 \u043b\u0435\u0433\u0447\u0435, \u0435\u0441\u043b\u0438 \u0432\u0437\u044f\u0442\u044c \u0432 \u0440\u0430\u0441\u0447\u0451\u0442 \u0442\u0438\u043f, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u041e\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d \u043a\u0430\u043a <em>int<\/em>, \u043d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0435\u0433\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043e \u043b\u0438\u043c\u0438\u0442\u0435 \u0432 16 \u0431\u0438\u0442 \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430. \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0445\u043c\u0443\u0440\u0438\u0442 \u0431\u0440\u043e\u0432\u0438:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v673\/\"><strong>V673<\/strong><\/a><strong> The &#8216;2000 &lt;&lt; 24&#8217; expression evaluates to 33554432000. 35 bits are required to store the value, but the expression evaluates to the &#8216;int&#8217; type which can only hold &#8217;32&#8217; bits.<\/strong><\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 12<\/strong><\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void SV_ExtractFromUserinfo (client_t *cl) \/\/ PVS-Studio: server\/sv_main.c  for (p = newname; (*p == ' ' || *p == '\\r' || *p == '\\n') &amp;&amp; *p; p++)      ; <\/code><\/pre>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0447\u0442\u043e-\u0442\u043e, \u0435\u0441\u043b\u0438 \u0432 \u0447\u0451\u043c-\u0442\u043e \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0440\u0430\u0437 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0432\u0438\u0434\u0435\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e\u043c \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e\u0433\u043e \u0434\u0443\u0445\u0430. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0432\u044b \u0436\u0435 \u043f\u043e\u043c\u043d\u0438\u0442\u0435 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e &#171;\u0418&#187;? \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v560\/\"><strong>V560<\/strong><\/a><strong> A part of conditional expression is always true: * p.<\/strong><\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 13<\/strong><\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void SV_Shutdown (void) \/\/ PVS-Studio: server\/sv_main.c  if (sv_logfile) {     fclose (sv_logfile);     sv_logfile = NULL; }  if (sv_fraglogfile) {     fclose (sv_fraglogfile);     sv_logfile = NULL; } <\/code><\/pre>\n<p>\u041a\u043b\u0430\u0441\u0441\u0438\u043a\u0430 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0430. \u041d\u0438 \u0434\u0430\u0442\u044c, \u043d\u0438 \u0432\u0437\u044f\u0442\u044c \u2013 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v778\/\"><strong>V778<\/strong><\/a><strong> Two similar code fragments were found. Perhaps, this is a typo and &#8216;sv_fraglogfile&#8217; variable should be used instead of &#8216;sv_logfile&#8217;.<\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/02b\/b30\/11b\/02bb3011b2f5ca416f4c9de9214d2e20.png\" alt=\"1066_Quake_World_ru\/image3.png\" title=\"\" width=\"1600\" height=\"902\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/02b\/b30\/11b\/02bb3011b2f5ca416f4c9de9214d2e20.png\"\/><\/figure>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0427\u0442\u043e \u0437\u0430 \u0432\u043e\u0441\u0445\u0438\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435! \u0418\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u043a\u043e\u0441\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u0432 \u043d\u0430\u0448\u0435\u0433\u043e \u0434\u0435\u043b\u0430 \u0431\u0435\u0441\u0446\u0435\u043d\u043d\u043e, \u0438 \u043c\u044b \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u044b id Software \u0437\u0430 \u0432\u044b\u043f\u0443\u0441\u043a \u0432 \u0441\u0432\u0435\u0442 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b \u0438\u0445 \u0438\u0433\u0440.<\/p>\n<p>\u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0434\u0435\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u0432\u0430\u0448\u0435 \u0432\u0440\u0435\u043c\u044f, \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c, \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0434\u0430\u0440\u043e\u043c, \u0438 \u043d\u0430\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0432\u0430\u0441 \u043f\u043e\u0432\u0435\u0441\u0435\u043b\u0438\u0442\u044c. \u0410 \u0435\u0441\u043b\u0438 \u0436\u0435 \u0430\u0432\u0442\u043e\u0440\u0443 \u044d\u0442\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u0432\u043d\u0435\u0441\u0442\u0438 \u0432 \u0432\u0430\u0448 \u043c\u0438\u0440 \u0447\u0442\u043e-\u0442\u043e \u043d\u043e\u0432\u043e\u0435 \u0438 \u043d\u0430\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043c\u044b\u0441\u043b\u0438, \u0442\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0441\u043e\u043c\u043d\u0435\u043d\u043d\u043e \u0440\u0430\u0434 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445!<\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u043c, \u0447\u0442\u043e \u0434\u043e\u0448\u043b\u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430! <em>El Psy Kongroo<\/em>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Anton Tretyakov. <a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/cpp\/1066\/\">Oh my C! How they wrote code back in the Quake days<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/758398\/\"> https:\/\/habr.com\/ru\/articles\/758398\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u0414\u0436\u043e\u043d \u041a\u0430\u0440\u043c\u0430\u043a: &#171;\u0424\u043e\u043a\u0443\u0441 \u2014 \u044d\u0442\u043e \u0443\u043c\u0435\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043d\u0430 \u0447\u0442\u043e \u0432\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u0442\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f&#187;. \u0422\u0430\u043a \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e \u0438 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0430\u043d\u0430\u043b\u0438\u0437\u0443 \u043a\u043e\u0434\u0430 \u043b\u0435\u0433\u0435\u043d\u0434\u0430\u0440\u043d\u043e\u0439 Quake World.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044f \u043a\u043e\u0434 \u0447\u0443\u0436\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0442\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430 \u043c\u0435\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0441\u043b\u0443\u0436\u0430\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0434\u043b\u044f \u043a\u043e\u043b\u043b\u0435\u0433-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 \u0438 \u0441\u0435\u0431\u044f \u0441\u0430\u043c\u043e\u0433\u043e, \u043f\u0443\u0441\u043a\u0430\u0439 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e. \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u0434\u0430\u0436\u0435 \u0432\u044b\u0439\u0434\u0435\u0442 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u044c\u0438! \u041d\u043e, \u0431\u044b\u0432\u0430\u0435\u0442, \u0432 \u0440\u0443\u043a\u0438 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0447\u0442\u043e \u043f\u0430\u043b\u044c\u0446\u044b \u043d\u0430\u0434 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u043e\u0439 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0442\u0440\u044f\u0441\u0442\u0438\u0441\u044c \u043e\u0442 \u0432\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0438\u043a\u043e\u043d\u0430\u043c\u0438 \u0438\u043d\u0434\u0443\u0441\u0442\u0440\u0438\u0438, \u043e\u043d \u043d\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0438 \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u0448\u0430\u043d\u0441\u0430 \u2013 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0437\u0430 \u0434\u0435\u043b\u043e \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e!<\/p>\n<p>\u0414\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0430 \u044d\u0442\u0438\u0445 \u0441\u0442\u0440\u043e\u043a Quake \u2013 \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u041f\u0443\u0441\u043a\u0430\u0439 \u043d\u0435 \u043f\u0435\u0440\u0432\u0430\u044f \u0438\u0433\u0440\u0430 \u0432 &#171;\u043f\u043e\u043b\u043d\u043e\u043c&#187; 3D (\u043c\u044b \u0441 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435\u043c \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0432\u0430\u0441 \u043f\u043e\u0441\u043f\u043e\u0440\u0438\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043e Descent), \u043e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u0430 id Software \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437 \u0441\u0434\u0432\u0438\u043d\u0443\u0442\u044c \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u0437\u0430 \u0440\u0430\u043d\u0435\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u044b\u0435 \u043f\u0440\u0435\u0434\u0435\u043b\u044b.<\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u044f \u0441 \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c, \u043d\u0435 \u043c\u0443\u0434\u0440\u0435\u043d\u043e \u0438 \u0437\u0430\u0431\u044b\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u0441\u0434\u0435\u043b\u0430\u043d \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435 \u043b\u044e\u0434\u044c\u043c\u0438 (\u0445\u043e\u0442\u044f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u041a\u0430\u0440\u043c\u0430\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c\u043e\u0439, \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0434\u043b\u044f \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0439), \u0430 \u043b\u044e\u0434\u0438 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<p>\u0422\u0430\u043a \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043f\u043e\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0443 \u043b\u0443\u0447\u0448\u0438\u0445 \u0438\u0437 \u043d\u0430\u0441! \u041c\u044b \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0432\u0430\u0441 \u0432 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d Quake World!<\/p>\n<blockquote>\n<p>\u041f\u043e \u0445\u043e\u0434\u0443 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430. \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0432 \u043d\u0438\u0445, \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u043a\u0430\u043a PVS-Studio: \u0438\u043b\u0438 \/\/ &#8230; \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0430\u0432\u0442\u043e\u0440\u043e\u043c \u0441\u0442\u0430\u0442\u044c\u0438, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0436\u0435 \u2013 \u0447\u0430\u0441\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>\u0421\u0430\u043c\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/id-Software\/Quake\/tree\/master\/QW\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0413\u0438\u0442\u0445\u0430\u0431\u0435 id Software<\/a>.<\/p>\n<\/blockquote>\n<h3>\u041c\u0443\u043b\u044c\u0442\u0438\u0432\u0441\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u0431\u0435\u0437\u0443\u043c\u0438\u044f<\/h3>\n<p>\u0412\u0430\u043c \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0430 \u0434\u0435\u043d\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u044f\u043c\u043e \u043a\u0430\u043a \u0443 \u0414\u043e\u043a\u0442\u043e\u0440\u0430 \u0421\u0442\u0440\u0435\u043d\u0434\u0436\u0430? \u041f\u0440\u044b\u0433\u0430\u0442\u044c \u0442\u0443\u0434\u0430-\u0441\u044e\u0434\u0430 \u043c\u0435\u0436\u0434\u0443 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u0440\u0430\u0437\u0440\u0435\u0437\u0430\u0442\u044c \u0442\u043a\u0430\u043d\u044c \u0441\u0430\u043c\u043e\u0433\u043e \u043c\u0438\u0440\u043e\u0437\u0434\u0430\u043d\u0438\u044f? \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0437\u0432\u0430\u043b \u0443 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u043a\u043e\u0440\u043d\u043e\u0433\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void Mod_LoadTexinfo (lump_t *l) \/\/ PVS-Studio: client\/model.c  mtexinfo_t *out; \/\/ ...  for (j=0 ; j&lt;8 ; j++){     ut->vecs[0][j] = LittleFloat (in->vecs[0][j]); } <\/code><\/pre>\n<p>\u0411\u0435\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0435 \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: client\/model.c  typedef struct {     float       vecs[2][4]; \/\/ PVS-Studio: see what is wrong here?     float       mipadjust;     texture_t   *texture;     int         flags; } mtexinfo_t; <\/code><\/pre>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: client\/common.h  float (*LittleFloat) (float l); <\/code><\/pre>\n<p>\u041d\u0443, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u0431\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043a\u0430\u043a \u0441 \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c. &#171;\u0410 \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0433\u043e? \u041e\u043d \u0436\u0435 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0435\u0436\u0438\u0442 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438!&#187; \u2014 \u0441\u043a\u0430\u0436\u0435\u0442 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0430\u0432 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 C99, 6.2.5 Types p20:<\/p>\n<blockquote>\n<p>An array type describes a contiguously allocated nonempty set of objects with a particular member object type, called the element type. The element type shall be complete whenever the array type is specified.<\/p>\n<\/blockquote>\n<p>\u041d\u043e \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043c \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043d\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044e \u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0438 \u0432 \u044f\u0437\u044b\u043a\u0435 C \u0442\u0438\u043f\u0430 <a href=\"https:\/\/c-faq.com\/aryptr\/aryvsadr.html\">\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432 T<\/a>? \u0418\u0442\u0430\u043a, \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0447\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c, \u0434\u0435\u043b\u0430\u044f \u043f\u0435\u0440\u0432\u043e\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u043c\u0430\u0441\u0441\u0438\u0432\u0443?<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>[]<\/em> \u0432\u0435\u0440\u043d\u0451\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0438\u043f\u0430 <em>float[4]<\/em>. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a <em>j<\/em> \u043f\u0440\u0435\u0432\u044b\u0441\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 3, \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0447\u0442\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432\u043d\u0435 \u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0435\u043b\u043e\u0432, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f (UB).<\/p>\n<p>\u041e, \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u043c\u0438\u0440 UB! \u0412 \u0433\u043e\u043b\u043e\u0432\u0435 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u0434\u0435\u043b\u0430\u043b \u0446\u0438\u043a\u043b \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u0434\u043c\u0430\u0441\u0441\u0438\u0432\u0435, \u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0432\u0442\u043e\u0440\u043e\u0439 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u041d\u0435 \u0441\u0430\u043c\u043e\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0435, \u0447\u0442\u043e \u043c\u043e\u0433\u043b\u043e \u0431\u044b \u0441\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0432 \u043d\u0430\u0448\u0438\u0445 \u0438\u0433\u0440\u0430\u0445, \u043d\u043e \u0437\u0430\u0447\u0435\u043c \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438 \u044d\u0442\u043e!<\/p>\n<p>\u0421\u0430\u043c\u044b\u043c \u0441\u043a\u0435\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c (\u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c) \u043c\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u043f\u0443\u043d\u043a\u0442\u043e\u0432 6.5.2.1\/2 \u0438 6.5.6\/8 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 \u042199:<\/p>\n<details class=\"spoiler\">\n<summary>\u041d\u0430\u0436\u043c\u0438 \u043c\u0435\u043d\u044f:<\/summary>\n<div class=\"spoiler__content\">\n<p> C99, 6\\.5\\.2\\.1\/2: <\/p>\n<p>A postfix expression followed by an expression in square brackets [] is a subscripted designation of an element of an array object. The definition of the subscript operator [] is that E1[E2] is identical to (*((E1)+(E2))). Because of the conversion rules that apply to the binary + operator, if E1 is an array object (equivalently, a pointer to the initial element of an array object) and E2 is an integer, E1[E2] designates the E2-th element of E1 (counting from zero).<\/p>\n<p>C99, 6.5.6\/8:<\/p>\n<p>When an expression that has integer type is added to or subtracted from a pointer, the result has the type of the pointer operand. If the pointer operand points to an element of an array object, and the array is large enough, the result points to an element offset from the original element such that the difference of the subscripts of the resulting and original array elements equals the integer expression. In other words, if the expression P points to the i-th element of an array object, the expressions (P)+N (equivalently, N+(P)) and (P)-N (where N has the value n) point to, respectively, the i+n-th and i\u2212n-th elements of the array object, provided they exist. Moreover, if the expression P points to the last element of an array object, the expression (P)+1 points one past the last element of the array object, and if the expression Q points one past the last element of an array object, the expression (Q)-1 points to the last element of the array object. If both the pointer operand and the result point to elements of the same array object, or one past the last element of the array object, the evaluation shall not produce an overflow; otherwise, the behavior is undefined. If the result points one past the last element of the array object, it shall not be used as the operand of a unary * operator that is evaluated.<\/p>\n<\/div>\n<\/details>\n<p>\u041e \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u0447\u0430\u0441\u0430\u043c\u0438. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 \u0441\u043a\u043e\u0440\u0435\u0435 \u043f\u043e\u0445\u0432\u0430\u043b\u044c\u043d\u043e, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0441\u0442\u0440\u0430\u0434\u0430\u0435\u0442. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u0442 \u0432\u0430\u0448 \u0434\u0438\u0441\u043a, \u043d\u043e <a href=\"https:\/\/randomascii.wordpress.com\/2014\/05\/19\/undefined-behavior-can-format-your-drive\/\">\u0437\u0430\u0447\u0435\u043c \u0440\u0438\u0441\u043a\u043e\u0432\u0430\u0442\u044c<\/a>?<\/p>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u0442\u043e \u043e\u043d \u0432\u044b\u0434\u0430\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u043e\u0435:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v557\/\"><strong>V557<\/strong><\/a><strong> Array overrun is possible. The value of &#8216;j&#8217; index could reach 7.<\/strong><\/p>\n<p><em>P.S. \u0427\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u0431\u044b \u043f\u0440\u0438\u0437\u043d\u0430\u044e\u0442 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u043a\u0438 \u0438 \u0434\u0430\u0436\u0435 \u0434\u0435\u043b\u0430\u044e\u0442 \u0441\u043e\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/em><\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void Mod_LoadTexinfo (lump_t *l) \/\/ PVS-Studio: server\/model.c  #if 0     for (j=0 ; j&lt;8 ; j++)         out->vecs[0][j] = LittleFloat (in->vecs[0][j]);     len1 = Length (in->vecs[0]);     len2 = Length (in->vecs[1]); #else     for (j=0 ; j&lt;4 ; j++) {         out->vecs[0][j] = LittleFloat (in->vecs[0][j]);         out->vecs[1][j] = LittleFloat (in->vecs[1][j]);     }     len1 = Length (out->vecs[0]);     len2 = Length (out->vecs[1]); #endif <\/code><\/pre>\n<h3>\u041d\u0435 \u0433\u0440\u043e\u0437\u0438 \u043c\u0435\u0441\u0442\u043d\u043e\u043c\u0443 \u0431\u0430\u0440\u0443, \u043f\u043e\u043f\u0438\u0432\u0430\u044f \u0431\u043e\u0440\u0436\u043e\u043c\u0438 \u0432 \u0441\u0430\u043d\u0430\u0442\u043e\u0440\u0438\u0438<\/h3>\n<p>\u041c\u044b \u0431\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0435\u0440\u0435\u0447\u044c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439, \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0447\u0443\u0442\u043a\u043e \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0445\u0441\u044f \u043a \u043b\u0443\u0447\u0448\u0438\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430\u043c: \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441!<\/p>\n<p>\u0410 \u0432\u044b, \u0445\u0440\u0430\u0431\u0440\u0435\u0446, \u0443\u0437\u0440\u0438\u0442\u0435!<\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void Sys_Printf (char *fmt, ...) \/\/ PVS-Studio: client\/sys_linux.c, server\/sys_linux.c  char text[2048];  va_start (argptr,fmt); vsprintf (text,fmt,argptr); va_end (argptr);  if (strlen(text) > sizeof(text))     Sys_Error(\"memory overwrite in Sys_Printf\"); <\/code><\/pre>\n<p>\u0411\u044b\u0442\u044c \u0432 \u043a\u0443\u0440\u0441\u0435, \u043a\u043e\u0433\u0434\u0430 \u0447\u0442\u043e-\u0442\u043e \u0438\u0434\u0451\u0442 \u043d\u0435 \u0442\u0430\u043a, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0438 \u0434\u0430\u0436\u0435 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u0430\u043a \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0448\u043b\u043e \u0432\u043e\u0432\u0441\u0435. \u041f\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0435\u0431\u044f \u043d\u0430 \u043c\u0435\u0441\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u2013 \u043a\u0430\u043a \u0431\u0435\u0434\u043e\u043b\u0430\u0433\u0435 \u0436\u0438\u0442\u044c \u0441 \u043c\u044b\u0441\u043b\u044c\u044e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e <em>\u0434\u043b\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043b\u0438\u043d\u043d\u0435\u0435, \u0447\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044d\u0442\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f<\/em>? \u0412\u043e\u0442 \u0438 \u0430\u0432\u0442\u043e\u0440 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430 \u0435\u0433\u043e \u043c\u0435\u0441\u0442\u0435 \u0431\u044b \u043d\u0435 \u0441\u043c\u043e\u0433 \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u0432\u0435\u0434\u044c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u043d\u0435 \u0440\u0430\u043c\u043e\u043a \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438 \u0440\u0430\u043d\u0435\u0435, \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0447\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435. \u0418 \u0432\u043e\u0442 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u043b\u0435\u0435 \u2013 \u0432\u0435\u0440\u044f, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432 \u0440\u0435\u043b\u0438\u0437\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0432\u043e\u0432\u0441\u0435 \u0443\u0431\u0435\u0440\u0451\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435, <em>vsprintf<\/em> \u0438\u0441\u043f\u043e\u0440\u0442\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0432 \u0437\u0430\u0442\u044f\u0436\u043d\u043e\u0435 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0435 \u043f\u043e \u0432\u044b\u0434\u0430\u0447\u0435 \u0432 \u043e\u043a\u043e\u0448\u043a\u0435 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a\u0430. \u0418 \u043f\u043e\u0434\u0435\u043b\u043e\u043c!<\/p>\n<p>\u041d\u0430\u0448 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440, \u043e\u0442\u043e\u0439\u0434\u044f \u043e\u0442 \u0448\u043e\u043a\u0430, \u0432\u044b\u0434\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v547\/\"><strong>V547<\/strong><\/a><strong> Expression &#8216;strlen(text) > sizeof (text)&#8217; is always false.<\/strong><\/p>\n<p>\u042d\u0442\u043e \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u043b\u0438\u0441\u044c \u0437\u0430\u043f\u043e\u0437\u0434\u0430\u043b\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: void Info_SetValueForStarKey (\/* ... *\/) \/\/ PVS-Studio: client\/common.c  if (strstr (key, \"\\\\\") || strstr (value, \"\\\\\") ) {     Con_Printf (\"Can't use keys or values with a \\\\\\n\");     return; } <\/code><\/pre>\n<p>\u041f\u043e\u043a\u0430 \u0447\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u0434\u0430\u0436\u0435 \u043d\u0435\u043f\u043b\u043e\u0445\u043e, \u043d\u043e \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u0447\u0438\u0442\u0430\u0435\u043c \u0447\u0443\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435:<\/p>\n<pre><code class=\"cpp\">if (!value || !strlen(value))     return; <\/code><\/pre>\n<p>\u0427\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u2013 \u0441\u0440\u043e\u0434\u043d\u0438 \u0434\u043e\u0431\u0440\u043e\u0434\u0435\u0442\u0435\u043b\u0438, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0430 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0432\u0440\u0435\u043c\u044f. \u041d\u0430\u0448 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u0433\u043b\u0430\u0441\u0435\u043d \u0441 \u0442\u0430\u043a\u0438\u043c \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v595\/\"><strong>V595<\/strong><\/a><strong> The &#8216;value&#8217; pointer was utilized before it was verified against nullptr.<\/strong><\/p>\n<h3>\u0427\u0435\u043c \u044d\u0442\u043e \u043f\u043e\u043f\u0430\u0445\u0438\u0432\u0430\u0435\u0442?<\/h3>\n<p>\u0410 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n<pre><code class=\"cpp\">\/\/ PVS-Studio: client\/d_sprite.c  static sspan_t  *sprite_spans;  void D_DrawSprite (void) {     sspan_t     spans[MAXHEIGHT+1];     sprite_spans = spans; \/\/ PVS-Studio: are you dead sure?     \/\/ ...     D_SpriteScanLeftEdge ();     D_SpriteScanRightEdge ();     D_SpriteDrawSpans (sprite_spans); }  void D_SpriteScanLeftEdge (void) {     pspan = sprite_spans;     \/\/ ... }  void D_SpriteScanRightEdge (void) {     pspan = sprite_spans;     \/\/ ... }  void D_SpriteDrawSpans (sspan_t *pspan) {     \/\/ PVS-Studio: pspan is used, among other things } <\/code><\/pre>\n<p>\u0410\u0432\u0442\u043e\u0440 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u043c\u043d\u0438\u0442 \u0441\u0430\u043c\u044b\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u043e\u0432\u0435\u0442 \u0438\u0437 \u0441\u0430\u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u043e\u0439 \u043a\u043d\u0438\u0436\u043a\u0438 \u043f\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0438\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0439 \u2013 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u043e\u043e\u0431\u0449\u0435! \u0424\u0443\u043d\u043a\u0446\u0438\u0438, \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0442\u0430\u043a\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0442\u0440\u0443\u0434\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c. \u041a\u0430\u043a \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u043e\u043d\u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u043d\u0435\u0440\u0435\u0435\u043d\u0442\u0440\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0432\u0440\u0430\u0442\u0430 \u0432 \u0430\u0434 (\u0438\u0437\u0432\u0438\u043d\u0438\u0442\u0435, <a href=\"https:\/\/www.gamedev.net\/articles\/programming\/general-and-gameplay-programming\/analyzing-doom-3-code-with-pvs-studio-r4293\/\">\u043e\u0448\u0438\u0431\u0441\u044f \u0438\u0433\u0440\u043e\u0439<\/a>).<\/p>\n<p>\u041d\u0443 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0431\u044b\u043b\u043e \u0442\u0430\u043a\u043e\u0435, \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c, \u0447\u0442\u043e \u0432\u044b \u0437\u0430\u0431\u044b\u0432\u0430\u043b\u0438 \u043f\u0440\u043e \u043c\u0435\u0441\u0442\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435? \u0423\u0436\u0435 \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u043e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 <em>\u0432\u043e\u043d \u0442\u043e\u0442 \u043d\u043e\u0432\u0435\u043d\u044c\u043a\u0438\u0439<\/em> \u0438\u0437 \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u0441\u0442\u0432\u0430 \u043d\u0430\u0440\u0443\u0448\u0430\u043b \u0441\u0432\u044f\u0449\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u043e \u0432\u044b\u0437\u043e\u0432\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>\u0410<\/em> \u0421\u0422\u0420\u041e\u0413\u041e \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>\u0411<\/em>?<\/p>\n<p>\u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435\u0441\u044c \u043a \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2013 \u0435\u0441\u0442\u044c \u043b\u0438 \u0442\u0430\u043c \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0438\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u043b\u043e\u0441\u0447\u0430\u0441\u0442\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439?<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v507\/\"><strong>V507<\/strong><\/a><strong> Pointer to local array &#8216;spans&#8217; is stored outside the scope of this array. Such a pointer will become invalid.<\/strong><\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u043d\u0430\u0448 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043f\u0430\u0445\u0438\u0432\u0430\u0435\u0442, \u0430 \u043d\u0435 \u043b\u043e\u043c\u0430\u0435\u0442 \u0438\u0433\u0440\u0443. \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u0445<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-353787","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/353787","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=353787"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/353787\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=353787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=353787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=353787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}