NO

Author Topic: Too many same line numbers used for 'size_t' warnings  (Read 3035 times)

colepc

  • Guest
Too many same line numbers used for 'size_t' warnings
« on: March 30, 2015, 03:15:25 PM »
I use warning level -W2. Please consider using the line number where the problem occurred when warning about 'size_t' instead of the line number where the variable is defined. Knowing where I can use an 'int' and where I need to use 'size_'t is useful. Note: Often the 'size_t' warning is stopped by using something other than 'size_t' such as 'unsigned int'.

An example:
i is declared on line 2312 such as:
int i;

The compiler gives multiple errors using the same line number such as:
FileName.c(2312): warning #2804: Consider changing type to 'size_t' for loop variable 'i'.
FileName.c(2312): warning #2804: Consider changing type to 'size_t' for loop variable 'i'.
FileName.c(2312): warning #2804: Consider changing type to 'size_t' for loop variable 'i'.
FileName.c(2312): warning #2804: Consider changing type to 'size_t' for loop variable 'i'.