Duane Ellis wrote:
> zack> [arrays]
>
> Dick> [nak arrays, they get out of sync, etc]
>
> ???>  [use C99 array initializers]
>
> All well and good, but remember their is this big nasty other compiler 
> that does not support C99... openocd does not build with that compiler.

Correct, and C++ does not support it either.   Why put up road blocks to 
a remotely possible move to C++?

>
> A second approach is - *NOT* an array, but a short array of structures 
> that implement a tag'ed array, during "init" - one time only, you sort 
> the array of structs, and verify the index values are (a) dense, (b) 
> no holes, and (c) start with zero!

The problem is the caller, coming in with a bad index, not the array 
itself.  The bad index, such as TAP_INVALID which is minus one, might 
give you a seg fault, but only if you are lucky.

>
> I had the same problem before C99... and it is/was a simple solution 
> that stopped bugs dead in their track.
>
> -Duane.
>
>

Duane,


This is the 3rd time now I am mentioning my need to get after the 
ft2232.c driver code, starting Monday.   I am happy to start from your 
starting point or from HEAD, but once I start, I won't be changing the 
road traveled.


Thanks,

Dick

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to