Hi, On Thu, Aug 4, 2011 at 5:29 PM, Miles Bader <mi...@gnu.org> wrote: > Jonathan Wakely <jwakely....@gmail.com> writes: >>> "g++ -Wall -Wextra ..." should flag a warning on the following code >>> but does not. >> >> Thanks for the apology, but it should still be reported to bugzilla >> not to this list.
I was hoping someone could submit a bugzilla report. I don't want to create an account which I may never use again. > > BTW, it should only warn if given -Weffc++, right? -Weffc++ does not catch the dangerous error in my code. -Wall caught another Item21 error somewhere else in my code: std::vector<XYZ*>& get_XYYs() { std::vector<XYZ*> result; return result; } I notice -Weffc++ produces more warnings on my code, but -Wall knows about Item21. Both -Weffc++ and -Wall only see get_XYZs() as an Item21 violation but not get_XYZ_data() which returns the local variable as a reference in an std::pair. > > -Miles > > -- > People who are more than casually interested in computers should have at > least some idea of what the underlying hardware is like. Otherwise the > programs they write will be pretty weird. -- Donald Knuth > Thanks. Regards, Fung Chai. -- FWIW: $\lnot \exists x \, {\rm Right} (x) \leftarrow \forall x \, {\rm Wrong} (x)$ \hfill -- Stephen Stills Freedom's just another word for nothin' left to lose -- Kris Kristofferson