[GRASS-dev] Is `typedef struct` considered as a bad practice?

Vaclav Petras wenzeslaus at gmail.com
Sat Feb 8 19:57:20 PST 2014


Hi C devs,

is following considered wrong in GRASS code?

typedef struct Point {
   int x;
   int y;
} Point;

/* alternatively */
typedef struct {
   int x;
   int y;
} Point;


I just saw r58957 and r49886 but till now I thought that typedefs (at the
same time as struct definition) are allowed or even preferred since they
are shorter. From C++ point of view `struct Point` is obsolete syntax which
does not help anybody, both compiler and programmer knows what is Point.

There is nothing about this is SUBMITTING or referred GNU Coding Standards
(at least I don't see anything).

Vaclav


http://trac.osgeo.org/grass/changeset/49886
http://trac.osgeo.org/grass/changeset/58957
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20140208/084375f9/attachment.html>


More information about the grass-dev mailing list