On Tue, May 12, 2009 at 11:49 AM, Øyvind Harboe <oyvind.har...@zylin.com> wrote:
> I think we should be extremely careful about defining public interfaces. > > Especially since the JTAG API still (yes still! the hard bits are done > though) needs work & cleanup. > > As an old colleague of mine(Mike Sinz) said: “Programming is > like sex: one mistake and you have to support it for the rest of your life.” This is probably an understatement. An ABI is serious trouble. :-( I started down this path with another project, and gave up. Lots of people want me to make a stable ABI for my procps project. I set up some of the things it would need, like symbol versioning and hidden symbol visibility. Then I realized what trouble I was in for, and put the project on hold. Any struct you expose in a *.h file will become cast in stone. Users will apply the sizeof operator, access the fields in the original order, depend on the original meaning (including their own guesses), etc. You can add accessor functions I suppose, forcing the users to use them by hiding the struct definitions, but that's slow/bloated/ugly. If you return int, then later decide you wanted size_t, you need to write a second function. The old function can be marked with the gcc deprecated attribute. A few years later, you still get screams when you remove the cruft. Linux vendors will cluelessly break your ABI. You get blamed. _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development