[exim-dev] UTF-8 and Exim string operations

2018-08-16 Thread Phil Pennock via Exim-dev
Anyone have strong feelings on how Exim should handle UTF-8 with
operators such as ${length_1:STR} ?

Document that the current operators work on bytes and add ulength_1 for
being UTF-8 aware?  Look at the top-bit being set and assume UTF-8, or
will that break too much with all the places which are still ISO-8859-1?

-Phil

-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim 
details at http://www.exim.org/ ##


Re: [exim-dev] C99 coding features

2018-08-16 Thread Andrew C Aitchison via Exim-dev

On Thu, 16 Aug 2018, Jeremy Harris via Exim-dev wrote:


Since f2ed27cf5f (between 4.89 & 4.90) we've documented
a requirement on C99-capable compilers.  This was the
introduction of specified-initialiser use in the Exim code.

How do people feel about other more-modern C features?

This was triggered by the Postgres hackers ML pointing out
that C99 permits variable declaration embedded in "for"
statements, eg:

for (int i = 0; ...) { ... }

Ref:
  6.8.5  Iteration statements

  Syntax

  iteration-statement:
  while ( expression ) statement
  do statement while ( expression ) ;
  for ( expr-opt ; expr-opt ; expr-opt ) statement
  for ( declaration ; expr-opt ; expr-opt ) statement


I'm tempted by that one.



I don't like mixing declarations with code.


To me the first is an example of the second.
OK, the variable declared in the for goes out of scope after the loop,
which makes it safer, but I am not sure that I can justify one
and not the other.
One of the projects I actually code for requires that variables are
instantiated when they are declared and it is clearer to give a new 
variable a value just before it is used than several pages up ...





Other possibilities mentioned include:
- variadic macros
- compound declarations:  function((struct x) {1, 2})


Comments?


I don't know enough about C99 to comment on its features.

---

Red Hat / CentOS / Scientific Linux 6 is too old to be a big worry
(especially as they have OpenSSL v1.0.1 which will be a bigger issue)
but on SL6 "man gcc" says
   c99
   c9x
   iso9899:1999
   iso9899:199x
   ISO C99.  Note that this standard is not yet fully supported;
   see  for more
   information.  The names c9x and iso9899:199x are deprecated.

Further, gcc v4.7, v4.8, v4.9, v5, v6 and v7 are available for these OSes 
from Red Hat / CentOS / Scientific Linux, which can be installed alongside

the default compilers and object code compiled with different versions
can be trivially linked together.

We may need to document compilation on RHEL6 and friends,
but I see no reason for it to stop the use of C99 features.

--
Andrew C. Aitchison Cambridge, UK
and...@aitchison.me.uk

--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim 
details at http://www.exim.org/ ##


[exim-dev] C99 coding features

2018-08-16 Thread Jeremy Harris via Exim-dev
Since f2ed27cf5f (between 4.89 & 4.90) we've documented
a requirement on C99-capable compilers.  This was the
introduction of specified-initialiser use in the Exim code.

How do people feel about other more-modern C features?

This was triggered by the Postgres hackers ML pointing out
that C99 permits variable declaration embedded in "for"
statements, eg:

for (int i = 0; ...) { ... }


Ref:
   6.8.5  Iteration statements

   Syntax

   iteration-statement:
   while ( expression ) statement
   do statement while ( expression ) ;
   for ( expr-opt ; expr-opt ; expr-opt ) statement
   for ( declaration ; expr-opt ; expr-opt ) statement


I'm tempted by that one.

I severely dislike C++ - style one-line comments:   code // comment.
I don't like mixing declarations with code.

Other possibilities mentioned include:
- variadic macros
- compound declarations:  function((struct x) {1, 2})


Comments?
-- 
Cheers,
  Jeremy

-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim 
details at http://www.exim.org/ ##