我在編譯一個C++應用程序,它使用C庫和GCC 4.7。非局部變量在C++中使用匿名類型警告
當我編譯,我收到以下警告:
warning: non-local variable ‘const ptg_t param’ uses anonymous type
warning: ‘typedef const struct<anonymous> ptg_t’ does not refer to the unqualified type, so it is not used for linkage
C++爲什麼把它僞裝成警告,其中c不? 有沒有一種方法可以解決它,而無需更改定義了ptg_t param
的庫頭文件?
由於C++和C是具有不同規則的不同語言? – chris 2013-05-05 09:21:27