Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove the VS warning C4091: 'typedef ' : ignored on left of 'SPREADSHEET' when no variable is declared

This warning is triggered multiple times in my code by the same declaration, which reads :

// Spreadsheet structure
typedef struct SPREADSHEET
{    
      int ID;               // ID of the spreadsheet    
      UINT nLines;          // Number of lines

      void CopyFrom(const SPREADSHEET* src)
      {
           ID = src->ID;
           nLines = src->nLines;
      }
};

I don't want to just turn off that warning,

but rather change the code so that the warning doesn't come up !

NOTE : I don't want to declare any variables here (it's a header file), only define what the struct 'SPREADSHEET' should include...

like image 729
Wartin Avatar asked May 26 '09 23:05

Wartin


1 Answers

Delete typedef. It's the C way of declaring structs, C++ does it automatically for you.

like image 197
Blindy Avatar answered Sep 17 '22 23:09

Blindy