[fossil-users] coding style guidelines: c89

2011-09-06 Thread Martin S. Weber
Hi, fossil currently does not build in a ANSI C-89 environment - a requirement of the coding style guidelines ([1], point 16). There's an obvious build error in http_ssl.c (C++ style comments), but there's something more in sha1.c... When adding a -std=c89 to the generated Makefile with gcc as

Re: [fossil-users] coding style guidelines: c89

2011-09-06 Thread Joerg Sonnenberger
On Tue, Sep 06, 2011 at 04:21:43PM -0400, Martin S. Weber wrote: When adding a -std=c89 to the generated Makefile with gcc as the compiler, I end up getting (ignoring the C++ style comment at line 87) That was part of http://fossil-scm.org/index.html/info/f2ede7da6d70851 I don't get that

Re: [fossil-users] coding style guidelines: c89

2011-09-06 Thread Ron Wilson
On Tue, Sep 6, 2011 at 4:21 PM, Martin S. Weber martin.we...@nist.gov wrote: (and many, many, many, many more lines like that). This seems to be because of the calls to asm() ... I don't know how to fix that. FYI, after preprocessing, the first instruction of line 104 looks like:  

Re: [fossil-users] coding style guidelines: c89

2011-09-06 Thread Dmitry Chestnykh
On Sep 6, 2011, at 11:19 PM, Ron Wilson wrote: The asm() calls are being used to invoke the rotate instructions. C does not have operators for peforming bitwise rotation of an operand and emulating a rotate using shifts is messy and very ineficient: unsigned int rotateLeft(unsigned int x,

Re: [fossil-users] coding style guidelines: c89

2011-09-06 Thread Ron Wilson
I guess I'm too used to dealing with dumb compilers. 1. Does it work with the C89 restrictions turned on? 2. Does C89 support inline functions? 3. If not, will it handle the folowing correctly? #define rotateLeft(x,n) { unsigned int t; t = x (SIZEOFINT - n); x = (x n) | t; } /* bitwise