On 06/05/2018 03:49 PM, David Malcolm wrote: > On Tue, 2018-06-05 at 04:40 -0400, Trevor Saunders wrote:
>> You may want to look at gdb's enum-flags.h which I think already >> implements what your doing here. > > Aha! Thanks! > > Browsing the git web UI, that gdb header was introduced by Pedro Alves > in: > > https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=8d297bbf604c8318ffc72d5a7b3db654409c5ed9 > and the current state is here: > > https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/common/enum-flags.h;hb=HEAD > > I'll try this out with GCC; hopefully it works with C++98. It should -- it was written/added while GDB still required C++98. Note I have a WIP series here: https://github.com/palves/gdb/commits/palves/cxx11-enum-flags that fixes a few things, and adds a bunch of unit tests. In the process, it uses C++11 constructs (hence the branch's name), but I think that can be reverted to still work with C++98. I had seen some noises recently about GCC maybe considering requiring C++11. Is that reasonable to expect in this cycle? (GDB requires GCC 4.8 or later, FWIW.) Getting that branch into master had fallen lower on my TODO, but if there's interest, I can try to finish it off soon, so we can share a better baseline. (I posted it once, but found some issues which I fixed since but never managed to repost.) > > Presumably it would be good to share this header between GCC and GDB; > CCing Pedro; Pedro: hi! Does this sound sane? > (for reference, the GCC patch we're discussing here is: > https://gcc.gnu.org/ml/gcc-patches/2018-05/msg01685.html ) Sure! Thanks, Pedro Alves