On 07/19/18 10:33, Andrew Robinson wrote:
Actually, Antonio came up with the better and simpler solution, which was to
consider extracting the strings to a separate file. That way if someone has a
non-conforming compiler and doesn't want to get rid of it and use something
else that is conforming,
How is a compiler that rejects bytes 128-255 in string literals
necessarily non-conforming? Does the C standard say that such things
should be allowed? I have not been able to find it; please let us know
if you find this. Now, knowing that not all compilers in practice do
accept this cleanly, it seems preferable to distribute sources in a form
which is clean as far as compilers are concerned, even if it is less
than optimal for programmer maintenance, but again, this can be solved
with some sort of conversion pass.
the programmer can do whatever is needed to make it
work by editing the strings file.
The strings themselves should not ever need editing to "make it work".
As long as the strings are already correctly encoded ISO8859-1 and
UTF-8, and no new messages, corrections, or translations are being
added, no change should be necessary, i.e. porting to a new platform or
compiler should never involve changing the strings file.
I don't like code that looks like it was
hacked with dull knife, and Antonio's solution was a way to avoid unreadable
or messy code.
To make my own position clear: The conversion routines I hacked together
should *NOT* be used in production. They are only meant as minimalist
examples of one sort of solution which could be attempted, although it
would very much need to be made more robust and, of course, less hacked.
The sort of general solution I would like to see for this class of
problem is a tool for copying exact byte strings, read from a file, into
constants data of compiled object, which can then be linked into library
to make such constants available. For portability, this might involve
expanding the strings into escape sequences understood to C compiler,
but the user(developer) shouldn't be burdened with this detail. Does
such a thing exist?
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users