Date: Wed, 4 Feb 1998 17:25:13 +0200 (IST) From: Eli Zaretskii To: DJ Delorie cc: eldredge AT ap DOT net, djgpp-workers AT delorie DOT com Subject: Re: NSIG ? In-Reply-To: <199802031340.IAA28128@delorie.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 3 Feb 1998, DJ Delorie wrote: > This is tricky, since arrays are not pointers you'd have to have two > complete arrays (one for each name) to prevent namespace pollution. I > had to do this for the error list (what perror/strerror uses). Yeah, I figured this would be the problem. It's hardly worth the hassle to have two identical arrays, I think. The question is, which one is more popular? To me it seemed that the version without the leading underscore is. Is the _sys_siglist[] variety found on SysV Unices? What does SGI use? At least Sun/Solaris here has sys_siglist, but that might be for compatibility with SunOS 4.x which is BSD. > You can cast a string *to* const, but it's harder to cast it away from > const. The problem is that if I say ``char *foo = "foobar";'', GCC treats foo as const char *, and then complains when I say ``sys_siglist[i] = foo;'' because sys_siglist is char [], not const char []. I couldn't find an easy way out of this, and I didn't want to use unconst since it is not really needed here. > The other problem is that programs not expecting the const may not > compile if they use non-const-char-* pointers to hold the values from > _sys_siglist[]. That was the other reason I decided not to worry about this. Both Emacs and Make (two programs that use sys_siglist[]) declare it as non-const.