Re: [Fx2lib-devel] fx2lib & stdbool.h
Status: Beta
Brought to you by:
mulicheng
From: Dennis M. <djm...@gm...> - 2011-03-14 20:23:55
|
Looks like it does need attention. Your 2nd question about pulling the changes in I think brings a good time to ask this.. I'm not working at the same place I was when I developed fx2lib and so changes are quite difficult for me to verify that they are good, pull, release etc. I was going to grab a board when I left but I seem to have forgotten to do that so I'm not even currently set up to deploy firmware and make sure things work. So... as it appears there is still interest in this project, is there someone using it enough that they would like to take over pulling in changes? A few of you already have github accounts so I could simply grant commit access to the repo for those accounts. On 03/13/2011 01:21 PM, Chris McClelland wrote: > I discovered an irritating problem. The fx2types.h > <https://github.com/mulicheng/fx2lib/blob/master/include/fx2types.h> > header defines BOOL thus: > typedef unsigned char BOOL; > ...whereas stdbool.h > <http://sdcc.svn.sourceforge.net/viewvc/sdcc/trunk/sdcc/device/include/stdbool.h?revision=5263&view=markup> > (sdcc 2.9.0) defines it: > #define BOOL __bit > This difference is crucial because it affects how the ABI returns BOOL > from function calls. In the former case BOOL is returned as a 0x00 or > 0x01 in DPL (an 8-bit register) whereas in the latter case it is > returned in the carry flag. Since stdbool’s definition of BOOL is a > preprocessor macro, merely including stdbool.h in the file defining > handle_vendorcommand() is enough to introduce subtle bugs where fx2lib > ignores the “actual” return value (in the carry flag) and instead > assumes the return value is in the DPL register, whose value will at > that point be garbage. > Now that I know about it, I can easily work around this mismatch, but > switching fx2lib to use stdbool.h seems like a good idea. It’s a trivial > change (about five lines changed), but my testing (though extensive) is > not exhaustive. Before I do the work to make a clone and send a pull > request, what are my chances of getting the change in? > Chris > > > > ------------------------------------------------------------------------------ > Colocation vs. Managed Hosting > A question and answer guide to determining the best fit > for your organization - today and in the future. > http://p.sf.net/sfu/internap-sfd2d > > > > _______________________________________________ > Fx2lib-devel mailing list > Fx2...@pu... > https://lists.sourceforge.net/lists/listinfo/fx2lib-devel |