Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

development tool to identify missed opportunity for "const" [closed]

Since C++ compilers can (usually) detect violations of constness, are there any tools that will identify missed opportunities for declaring something as const?

like image 825
Chap Avatar asked Sep 17 '13 17:09

Chap


1 Answers

gcc has -Wsuggest-attribute=[pure|const|noreturn|format], but I believe these are limited to functions and function pointers.

http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

like image 100
kchoi Avatar answered Nov 17 '22 07:11

kchoi