Hello! There is a function:

#include <math.h> ... void mat4x4_projection(mat4x4 m, const float fov, const float aspect, const float n, const float f) { mat4x4_identity(m); const float ctg_half_fov = 1.0f/tanf(fov/2); m[0][0] = ctg_half_fov/aspect; m[1][1] = ctg_half_fov; m[2][2] = (f+n)/(fn); m[3][2] = (-2.0f*f*n)/(fn); m[2][3] = 1.0f; m[3][3] = 0.0f; } 

If we replace the names of the parameters f and n with far and near respectively, then the compiler produces the error: Parameter name ommited .

The words far and near do not appear as key (looked at http://en.cppreference.com/w/c/keyword ).

Actually the question, what could be the cause of this error?

 Win 10 x64 gcc 4.8.1 
  • Specify your OS, compiler and their versions. I do not play on Linux either in GCC or in Clang. - Ainar-G
  • @ Ainar-G, updated the question. - eanmos
  • @ 0andriy I think you can send this link with a quote from it as an answer. - Ainar-G
  • @ 0andriy, no, the project definitely doesn’t. So, after all, in the headers of Windows. - eanmos
  • one
    A thousand years ago, when the 286 pisyuki had just appeared, MS released the C-compiler (as I recall, V6), which included the keywords far and near . They told the compiler where this object is located - within the 64K address space, or further. It seems to me that this is just about it ... - Sergey

1 answer 1

Long ago, when computers were 8-bit and 16-bit, and 32-bit just appeared, there were special annotations to pointers in the DOS and Windows environment (more often it was about function pointers), indicating whether segment registers for addressing. So, far answered that the pointer lies outside the current code segment, when near indicated that the address is located inside the current code segment.

To support this legacy, some compilers still contain these annotations. That is why you get an error.

The essence of the problem is described in more detail here in relation to the Windows environment and the MinGW compiler.