[SystemSafety] C++ and Pointers

Derek M Jones derek at knosof.co.uk
Wed Jun 5 16:04:58 CEST 2019


David,

> However, "int* iPtr1, iPtr2" is not equivalent to "int *iPtr1; int *iPtr2"; but rather to "int
> *iPtr1; int iPtr2".
> <<
> Yes, "int* iPtr1, iPtr2" is confusing. Very few C or C++ programmers would write that.

This is the sort of thing that everybody accidentally writes,
every now and again.  This issue has been known about by tool
vendors since the origin of C.

If Peter wants to rant about C++ there are much bigger targets, for
instance the 42 ways of printing hello:
https://speakerdeck.com/olvemaudal/42-silly-ways-to-say-hello-in-modern-c-plus-plus-sep-2018

and things are getting a lot worse:
https://shape-of-code.coding-guidelines.com/2018/04/14/the-c-committee-has-taken-off-its-ball-and-chain/


-- 
Derek M. Jones           Software analysis
tel: +44 (0)1252 520667  blog:shape-of-code.coding-guidelines.com


More information about the systemsafety mailing list