[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: svn commit: r1053996 [1/2] - in /subversion/trunk/subversion: include/ include/private/ libsvn_client/ libsvn_diff/ libsvn_fs_base/ libsvn_fs_base/bdb/ libsvn_fs_fs/ libsvn_ra_neon/ libsvn_ra_serf/ libsvn_ra_svn/ libsvn_subr/ libsvn_wc/ mod_authz_svn/

From: Bert Huijben <bert_at_qqmail.nl>
Date: Tue, 4 Jan 2011 16:44:10 +0100

> -----Original Message-----
> From: Branko Čibej [mailto:brane_at_xbc.nu]
> Sent: dinsdag 4 januari 2011 16:27
> To: dev_at_subversion.apache.org
> Subject: Re: svn commit: r1053996 [1/2] - in
> /subversion/trunk/subversion: include/ include/private/ libsvn_client/
> libsvn_diff/ libsvn_fs_base/ libsvn_fs_base/bdb/ libsvn_fs_fs/
> libsvn_ra_neon/ libsvn_ra_serf/ libsvn_ra_svn/ libsvn_subr/ libsvn_wc/
> mod_authz_svn/
>

> I frankly see no reason at all to do this "everywhere", it's just
> unnecessary code churn. The struct tags are only useful if the
> structure
> references itself (via pointers), and our practice for such cases was
> to
> declare the typedef first, and the struct itself below it, and use the
> typedef name in the struct definition.
>
> So unless someone can explain the reasoning why all these anonymous
> structs and enums etc. should have names -- on technical grounds, not
> some stylistic hand-waving -- then please revert.

2 minor (but to me very useful) reasons to use an explicit name:
* svn diff -x -p shows the structname this way, so it makes commit diffs more readable
* Debuggers that handle typedefs as an alias for the struct (such as Visual Studio) show foo_t in the debugger output instead of __unnamed_ABCDEF (ABCDEF is a hex number which can change between compiler invocations).

        Bert
Received on 2011-01-04 16:44:46 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.