<div dir="ltr">In general I don't see any point in keeping compatibility with a standard as old as C89, what target (that we support) still needs that?<div><br></div><div>The items that are obviously likely to be useful to Geany I have marked in the list with **.  Some of these may come with magic options to gcc, but that limits us to that compiler.</div>
<div><br></div><div>The more we can allow modern(ish :) programming styles using a well known standard the simpler it is to produce correct code (eg inlines not macros, who will remember that EMPTY may compute its arguments multiple times).</div>
<div><br></div><div>At the moment C11 is too new (not enough complete support) but C99 is fine.</div><div><br></div><div>Unless we follow the example of gcc itself and upgrade to C++ :)<br><div class="gmail_extra"><br><br>
<div class="gmail_quote">On 16 August 2013 16:07, Matthew Brush <span dir="ltr"><<a href="mailto:mbrush@codebrainz.ca" target="_blank">mbrush@codebrainz.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
Up till now we've tried to stay compatible with ANSI C89 because of GTK+-stack doing so (unless I missed the real reason?).<br>
<br>
I propose we update to allowing C99 for the following reasons:<br>
<br>
- restricted character set support in <iso646.h> (originally specifed in AMD1)<br>
- wide-character library support in <wchar.h> and <wctype.h> (originally specifed in AMD1)<br>** - restricted pointers<br>** - variable-length arrays<br>** - flexible array members<br>
- complex (and imaginary) support in <complex.h><br>
- type-generic math macros in <tgmath.h><br>
- the long long int type and library functions<br>
- increased translation limits<br>
- remove implicit int<br>** - the vscanf family of functions<br>** - reliable integer division<br>
- universal character names<br>
- extended identifers<br>
- binary foating-point literals and printf/scanf conversion specifers<br>
- compound literals<br>** - designated initializers<br>** - // comments<br>** - extended integer types in <inttypes.h> and <stdint.h><br>** - remove implicit function declaration<br>** - preprocessor arithmetic done in intmax_t/uintmax_t<br>
** - mixed declarations and code<br>** - integer constant type rules<br>
- integer promotion rules<br>
- vararg macros<br>
- additional math library functions in <math.h><br>
- foating-point environment access in <fenv.h><br>
- IEC 60559 (also known as IEC 559 or IEEE arithmetic) support<br>
- trailing comma allowed in enum declaration<br>
- %lf conversion specifer allowed in printf<br>** - inline functions<br>** - the snprintf family of functions<br>** - boolean type in <stdbool.h><br>
- idempotent type qualifers<br>
- empty macro arguments<br>** - new struct type compatibility rules (tag compatibility)<br>
- _Prama preprocessing operator<br>
- standard pragmas<br>
- __func__ predefned identifer<br>
- VA_COPY macro<br>
- additional strftime conversion specifers<br>
- LIA compatibility annex<br>
- deprecate ungetc at the beginning of a binary file<br>
- remove deprecation of aliased array parameters<br>
<br>
(Source: list is 2nd hand from <a href="http://www.open-std.org/JTC1/sc22/wg14/www/docs/n869/" target="_blank">http://www.open-std.org/JTC1/<u></u>sc22/wg14/www/docs/n869/</a>)<br>
<br>
And that's just improvements since 1999 (way back when I was in high school), not to mention more recent changes in the latest C11 standard.<br>
<br>
I think for us the most likely consequences are:<br>
<br>
- Coding in the new millennium style :)<br>
- Microsoft Visual C++ compiler is not C99 conformant and plans not to ever be AFAIK (of little consequence since we don't compile with MSVC).<br>
- Allowed to use // style comments<br>
- Allowed to declare loop counter-style variable inside the for loop.<br>
- Use standard C instead of G*-portability wrappers in various place (bool, fixed-width ints, etc.).<br>
<br>
This is just sort of random, but I feel that some our code could be better if we depended less on G*-stack and more on (>10 year old) ISO standards.<br>
<br>
P.S. Sorry for the bikeshed bait.<br></blockquote><div><br></div><div>Red and purple.</div><div><br></div><div>Cheers</div><div>Lex</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Cheers,<br>
Matthew Brush<br>
______________________________<u></u>_________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.geany.org" target="_blank">Devel@lists.geany.org</a><br>
<a href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel" target="_blank">https://lists.geany.org/cgi-<u></u>bin/mailman/listinfo/devel</a><br>
</blockquote></div><br></div></div></div>