The Funny Side

Stay Tuned for This Important Message

Jeffrey Haemer reporting on Posix, in <13501@cs.utexas.edu>:

Stay_Tuned_for_This_Important_Message

If you haven't yet had the pleasure of internationalizing applications, chances are you will soon. When you do, you'll face messaging: modifying the application to extract all text strings from external data files. The sun is setting on

main()
{
        printf("hello, world\n");
}

and we're entering a long night of debugging programs like this:

#include <stdio.h>
#include <nl_types.h>
#include "msg.h" /* decls of catname(), etc. */
#define GRTNG "hello, world\n"
nl_catd catd;

main()
{
        setlocale(LC_ALL, "");
        catd = catopen(catname(argv[0]), 0);
        printf(catgets(catd, SETID, MSGID, GRTNG));
        catclose(catd);
        exit(0);
}

This, um, advance stems from a desire to let the program print

ch`o c'c ^ng

instead of

hello, world

when LANG is set to ``Vietnamese.''

We observe that in order to get past a discriminating ANSI compiler, (eg. gcc -Wall -ansi -pedantic) "hello world" has already become:

#include <stdio.h>

int
main()
{
        (void) printf("hello world\n");
        return 0;
}

[Or do I also need to include stddef.h?]

Mark.