Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get vc++ and g++ to behave the same regarding typename for dependent qualified types?

Is there a switch I can supply to cl.exe that will enable a warning or error when a typename is missing from a qualified dependent type?

I'm working in an environment where developers tend to work one one platform, either Windows or Linux, and the code is ultimately built on both platforms nightly. We've encountered a problem with people forgetting to use typename on qualified dependent types on Windows, where Visual C++ 2008 will automatically insert a missing typename if possible. When they check in the code like this, it breaks the build on Linux, where g++ requires the typename. It would be desirable to tweak the Makefile such that we can expect the same typename behaviour on Windows and Linux to mitigate the likelihood of the build breaking. I prefer the g++ behaviour, but anything that would help the two platforms behave the same would be much appreciated.

See also Why do I need to use typedef typename in g++ but not VS?

like image 502
mrkj Avatar asked Nov 30 '10 15:11

mrkj


1 Answers

My workplace solved all problems of this kind by introducing a continuous integration server. In our case we were quite satisfied with TeamCity. It is very customizable, and with some bash scripting I am sure you can present gcc errors nicely within TeamCity. I customized our server to the point where I was also getting Doxygen errors presented nicely and we reduced the number of errors from an initial 11000 to 0, over a couple of months.

Good luck!

like image 192
Daniel Lidström Avatar answered Oct 31 '22 03:10

Daniel Lidström