Re: [Openocd-development] RFC: libopenocd strategy

2009-05-12 Thread Albert Cahalan
On Tue, May 12, 2009 at 11:49 AM, Øyvind Harboe 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: “Programmin

Re: [Openocd-development] C99 compatibility (Was: MSVC compatibility (Was: [PATCH] CMake))

2009-04-30 Thread Albert Cahalan
On Thu, Apr 30, 2009 at 10:03 AM, Øyvind Harboe wrote: > C++ *can* be a pretty hellish language if one goes overboard > with weird features and libraries... Right. Nobody intends to do this, yet it happens. Every developer has his pet C++ feature. Ultimately the project ends up with the union o

Re: [Openocd-development] C99 compatibility (Was: MSVC compatibility (Was: [PATCH] CMake))

2009-04-30 Thread Albert Cahalan
On Thu, Apr 30, 2009 at 2:25 PM, Michael Bruck wrote: > On Thu, Apr 30, 2009 at 9:25 AM, Albert Cahalan wrote: >> On Thu, Apr 30, 2009 at 1:59 AM, Michael Bruck wrote: > This is a random snippet from the Linux kernel. > > The readability of this would benefit from remo

Re: [Openocd-development] C99 compatibility (Was: MSVC compatibility (Was: [PATCH] CMake))

2009-04-30 Thread Albert Cahalan
On Thu, Apr 30, 2009 at 2:41 PM, Michael Bruck wrote: > On Thu, Apr 30, 2009 at 8:22 PM, Nico Coesel wrote: >> are embedded firmware engineers. Most embedded firmware engineers I know >> have very little to do with C++, OO programming and the STL / boost >> libraries. These people probably won't

Re: [Openocd-development] C99 compatibility (Was: MSVC compatibility (Was: [PATCH] CMake))

2009-04-30 Thread Albert Cahalan
On Thu, Apr 30, 2009 at 9:53 AM, Dick Hollenbeck wrote: > Michael Schwingen wrote: >> I really like the designated initializers, and would miss these most. >> IMHO, they can make the code safer and easier to understand. ... > They can make the code safer and easier to understand, yes. They have

Re: [Openocd-development] MSVC compatibility (Was: [PATCH] CMake)

2009-04-30 Thread Albert Cahalan
On Wed, Apr 29, 2009 at 11:04 AM, Igor Skochinsky wrote: > Just Visual Studio 2005, but I guess the exact version does not matter much. It does matter. You need to upgrade if you want printf-family functions to support long long correctly. If you don't upgrade, you'll be doing this: #ifdef _MSC

Re: [Openocd-development] C99 compatibility (Was: MSVC compatibility (Was: [PATCH] CMake))

2009-04-30 Thread Albert Cahalan
On Thu, Apr 30, 2009 at 1:59 AM, Michael Bruck wrote: > On Thu, Apr 30, 2009 at 7:12 AM, Zach Welch wrote: >> At the most fundamental level, it comes down to this: >> >> C == imperative programming >> C++ == object-oriented programming >> >> The different mindsets should yield completely diffe

Re: [Openocd-development] C99 compatibility (Was: MSVC compatibility (Was: [PATCH] CMake))

2009-04-29 Thread Albert Cahalan
On Thu, Apr 30, 2009 at 1:57 AM, Strontium wrote: > That said, I don't like C99, because of the issues it introduces with > regard to strict aliasing. I still don't understand why the language > specification cares about making life easy for an optimiser more than it > cares about the correctnes

Re: [Openocd-development] [PATCH] Fix build errors in SVN on x86_64

2009-04-26 Thread Albert Cahalan
On Mon, Apr 27, 2009 at 1:41 AM, Øyvind Harboe wrote: > What's wrong with this code? > >long long then=timeval_ms(); >while ((timeval_ms()-then) > This appears many places in the code. > > comparision will work unless the difference is > greater than 31/63 bits in s

Re: [Openocd-development] [PATCH] add -std=c99 or -std=gnu99?

2009-04-26 Thread Albert Cahalan
On Sun, Apr 26, 2009 at 1:35 PM, Rick Altherr wrote: > On Apr 26, 2009, at 1:06 AM, Albert Cahalan wrote: >> As you noticed, weird things can happen. :-( >> >> For MacOS, don't define anything to indicate >> BSD or POSIX source. That would break stuff. > >

Re: [Openocd-development] [PATCH] add -std=c99 or -std=gnu99?

2009-04-26 Thread Albert Cahalan
As you noticed, weird things can happen. :-( For MacOS, don't define anything to indicate BSD or POSIX source. That would break stuff. For Linux, the FSF bastards demand _GNU_SOURCE as part of their plan to give Linux an ugly name. I suggest: -std=gnu99 (accept modern code) -D_GNU_SOURCE (satisf