Am 17.01.2015 um 17:11 schrieb Mark Odell:
> Nice but I'd suggest looking more ANSI and having a consistent naming
> scheme that better reflects the type...
> 
> #include <stdlib.h>
> #include <inttypes.h>
> 
> typedef struct // No struct tag, must use typedef.
> {
>         union {
>                 void     *void_p;
>                 uint8_t  *uint8_p;
>                 int8_t   *int8_p;
>                 uint16_t *uint16_p;
>                 int16_t  *int16_p;
>                 uint32_t *uint32_p;
>                 int32_t  *int32_p;
>         }; // Anonymous union makes use easier
[snip]

I vaguely recall that gcc 4.8+ warns about anonymous unions?

Also some other projects do name structs despite using typedefs, as
that's supposedly the name gdb picks up.

Anyway, not all variables are pointers and there's nothing fundamentally
wrong with using casts when you know what you're doing. :)

Cheers,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu,
Graham Norton; HRB 21284 (AG Nürnberg)

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to