Re: xsize and flexmember

2020-04-30 Thread Paul Eggert
On 4/29/20 11:39 PM, Marc Nieper-Wißkirchen wrote: >> #define XFLEXSIZEOF_XSIZE(type, member, n) \ >> (((n) <= FLEXSIZEOF (type, member, n) \ >> && FLEXSIZEOF (type, member, n) <= (size_t) -1) \ >>? (size_t) FLEXSIZEOF (type, member, n) : (size_t) -1) >> >> A couple of problems with

Re: Unicode string literals

2020-04-30 Thread Marc Nieper-Wißkirchen
Am Do., 30. Apr. 2020 um 22:54 Uhr schrieb Paul Eggert : > > On 4/30/20 6:08 AM, Bruno Haible wrote: > > These not-so-new compilers don't perform > > character set conversion; you have to provide the numeric value of each > > byte yourself (either as escapes, or by enumerating the bytes of the > >

Re: xsize and flexmember

2020-04-30 Thread Paul Eggert
On 4/30/20 2:01 PM, Marc Nieper-Wißkirchen wrote: #define XFLEXSIZEOF_XSIZE(type, member, n) \ (((n) <= FLEXSIZEOF (type, member, n) \ && FLEXSIZEOF (type, member, n) <= (size_t) -1) \ ? (size_t) FLEXSIZEOF (type, member, n) : (size_t) -1) > > Why do you write "(n)

Re: Unicode string literals

2020-04-30 Thread Paul Eggert
On 4/30/20 6:08 AM, Bruno Haible wrote: > These not-so-new compilers don't perform > character set conversion; you have to provide the numeric value of each > byte yourself (either as escapes, or by enumerating the bytes of the > string one by one). Could we have a macro to be used only in source

Re: Unicode string literals

2020-04-30 Thread Paul Eggert
On 4/30/20 2:05 PM, Marc Nieper-Wißkirchen wrote: >> Could we have a macro to be used only in source code encoded via UTF-8? >> Presumably the older compilers would process the bytes of the string as if >> they >> were individual 8-bit characters and would pass them through unchanged, so >> the

Re: Unicode string literals

2020-04-30 Thread Bruno Haible
Hi Marc, > I was hoping that compilers not supporting enough of C11 > would have some other way to translate from the source file encoding > to UTF-8, which could be exploited by Gnulib. No, that's not the case. These not-so-new compilers don't perform character set conversion; you have to

Re: pure and const function attributes

2020-04-30 Thread Marc Nieper-Wißkirchen
Am Mi., 29. Apr. 2020 um 18:05 Uhr schrieb Marc Nieper-Wißkirchen : > > > Paul Eggert schrieb am Mi., 29. Apr. 2020, 18:01: >> >> On 4/29/20 7:28 AM, Marc Nieper-Wißkirchen wrote: >> > I am wondering whether it makes sense to add two new modules, named >> > pure and const that define macros

Re: xsize and flexmember

2020-04-30 Thread Marc Nieper-Wißkirchen
Thank you very much for your quick response! Am Do., 30. Apr. 2020 um 00:39 Uhr schrieb Paul Eggert : > > On 4/29/20 12:29 PM, Marc Nieper-Wißkirchen wrote: > > It would be great if the flexmember exported another macro, say > > XFLEXSIZEOF, which returned SIZE_MAX in case of arithmetic overflow.

Unicode string literals

2020-04-30 Thread Marc Nieper-Wißkirchen
On a system that supports at least C11, I can create an UTF8-encoded literal string through: (uint8_t const *) u8"..." Could Gnulib abstract this into a macro so that substitutes for systems that do not have u8 string literals can be provided. On a C11 system, we would have #define UTF8(s)

Re: Unicode string literals

2020-04-30 Thread Bruno Haible
Hi Marc, Marc Nieper-Wißkirchen wrote: > On a system that supports at least C11, I can create an UTF8-encoded > literal string through: > > (uint8_t const *) u8"..." > > Could Gnulib abstract this into a macro so that substitutes for > systems that do not have u8 string literals can be

Re: Unicode string literals

2020-04-30 Thread Marc Nieper-Wißkirchen
Hi Bruno, thank you very much for your reply. Am Do., 30. Apr. 2020 um 12:06 Uhr schrieb Bruno Haible : [...] > Unfortunately, we cannot provide such macros. The reason is that the > translation from the source file's encoding to UTF-8/UTF-16/UTF-32 must > be done by the compiler, if you want