Thanks William, that was thorough! I prefer the Port *p personally and maybe that's just old habit.
And since most of the old code is that way, we should replace-in-file any differences to the "old way" and then update the style guide. And I nominate Nate to add in a gem5 style hook to enforce this (haha, j/k)! On Wed, Jan 11, 2012 at 5:17 AM, William Wang <[email protected]> wrote: > int* p; // OO Style, Type emphasis > int *p; // Procedural style, Expression emphasis > int * p; // Unconventional Style, No emphasis > > A public coding style from Google: > > http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Pointer_and_Reference_Expressions > // These are fine, space preceding. > char *c; > const string &str; > > // These are fine, space following. > char* c; // but remember to do "char* c, *d, *e, ...;"! > const string& str; > > char * c; // Bad - spaces on both sides of * > const string & str; // Bad - spaces on both sides of & > > A discussion on stackoverflow: > What's your preferred pointer declaration style, and why? > > http://stackoverflow.com/questions/377164/whats-your-preferred-pointer-declaration-style-and-why > > > > > -- IMPORTANT NOTICE: The contents of this email and any attachments are > confidential and may also be privileged. If you are not the intended > recipient, please notify the sender immediately and do not disclose the > contents to any other person, use it for any purpose, or store or copy the > information in any medium. Thank you. > > _______________________________________________ > gem5-dev mailing list > [email protected] > http://m5sim.org/mailman/listinfo/gem5-dev > -- - Korey _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
