Discussion:
Dillo and Irix
Jan Diegelmann
2014-04-07 10:13:25 UTC
Permalink
Hello,

I just started another attempt to port dillo to Irix. With gcc 4.7 it
compiles without any serious warnings. It starts and about:splash shows
up correctly, But if you want to use it something goes wrong:

ftp works without problems.

files show up if the path is very short (less than 32 bytes). If you
browse directories and you want to change from /tmp to /tmp/x for
example. I changes to /x

http doesn't work at all. If you go to a non existing url. For example:
http://test.yy you get the following console output, but nothing happens
in the dollo window:

Nav_open_url: new url='http:test.yy'
a_Capi_ccc : OpStart [2B] Info=10262fa8 Flags=0
a_Dpi_ccc : OpStart [2B] Info=10262da0 Flags=0
a_IO_ccc : OpStart [2B] Info=10262e90 Flags=0
a_Capi_ccc : OpStart [1B] Info=10262eb8 Flags=0
a_Http_ccc : OpStart [1B] Info=10262f80 Flags=0
a_IO_ccc : OpStart [1B] Info=10262e40 Flags=0
Http_must_use_proxy: http:test.yy
NO
DNS error: HOST_NOT_FOUND
Dns_server [0]: is (nil)
a_IO_ccc : OpAbort [1B] Info=10262e40 Flags=0
a_Capi_ccc : OpAbort [1F] Info=10262eb8 Flags=0
a_Capi_ccc : OpAbort [2B] Info=10262fa8 Flags=0
a_Dpi_ccc : OpAbort [2B] Info=10262da0 Flags=0
a_IO_ccc : OpAbort [2B] Info=10262e90 Flags=0


If you are opening an existing url like dillo.org it puts out:

Nav_open_url: new url='http://www.dillo.org/'
a_Capi_ccc : OpStart [2B] Info=10262fd0 Flags=0
a_Dpi_ccc : OpStart [2B] Info=10262f08 Flags=0
a_IO_ccc : OpStart [2B] Info=10262e68 Flags=0
a_Capi_ccc : OpStart [1B] Info=10262ee0 Flags=0
a_Http_ccc : OpStart [1B] Info=10262e90 Flags=0
a_IO_ccc : OpStart [1B] Info=10262f30 Flags=0
Http_must_use_proxy: http://www.dillo.org/
NO
Dns_server [0]: www.dillo.org is 85.214.105.140
Connecting to 85.214.105.140
a_IO_ccc : OpSend [1B] Info=10262f30 Flags=0
a_Capi_ccc : OpSend [1F] Info=10262ee0 Flags=0
a_Capi_ccc : OpSend [2B] Info=10262fd0 Flags=0
a_Dpi_ccc : OpSend [2B] Info=10262f08 Flags=0
a_IO_ccc : OpSend [2B] Info=10262e68 Flags=0
http, referer='Referer: http://www.dillo.org/
'
Query: {GE}
a_IO_ccc : OpSend [1B] Info=10262f30 Flags=0


and after some seconds:

a_IO_ccc : OpEnd [2F] Info=10262e68 Flags=0
a_Dpi_ccc : OpEnd [2F] Info=10262f08 Flags=0
a_Capi_ccc : OpEnd [2F] Info=10262fd0 Flags=0
a_Capi_ccc : OpEnd [1B] Info=10262ee0 Flags=0
a_Http_ccc : OpEnd [1B] Info=10262e90 Flags=0
a_IO_ccc : OpEnd [1B] Info=10262f30 Flags=0

but nothing happens in the dillo window.

I would be very happy to get any hint what is going wrong here.

Thanks you,

Jan
eocene
2014-04-07 15:28:03 UTC
Permalink
Post by Jan Diegelmann
Query: {GE}
a_IO_ccc : OpSend [1B] Info=10262f30 Flags=0
"GE" is the entire query?
Jan Diegelmann
2014-04-07 15:58:16 UTC
Permalink
Post by eocene
Post by Jan Diegelmann
Query: {GE}
a_IO_ccc : OpSend [1B] Info=10262f30 Flags=0
"GE" is the entire query?
Yes exactly. Any idea?
eocene
2014-04-07 16:44:07 UTC
Permalink
Post by Jan Diegelmann
Post by eocene
Post by Jan Diegelmann
Query: {GE}
a_IO_ccc : OpSend [1B] Info=10262f30 Flags=0
"GE" is the entire query?
Yes exactly. Any idea?
Can you watch what goes wrong in a_Http_make_query_str()?
eocene
2014-04-07 17:48:40 UTC
Permalink
Post by eocene
Post by Jan Diegelmann
Post by eocene
Post by Jan Diegelmann
Query: {GE}
a_IO_ccc : OpSend [1B] Info=10262f30 Flags=0
"GE" is the entire query?
Yes exactly. Any idea?
Can you watch what goes wrong in a_Http_make_query_str()?
Between this and the file path thing, I wonder whether irix
doesn't like that va_list/va_copy/vsnprintf stuff in the dStr
code in dlib/dlib.c.
Jan Diegelmann
2014-04-10 20:41:47 UTC
Permalink
Post by eocene
Post by eocene
Post by Jan Diegelmann
Post by eocene
Post by Jan Diegelmann
Query: {GE}
a_IO_ccc : OpSend [1B] Info=10262f30 Flags=0
"GE" is the entire query?
Yes exactly. Any idea?
Can you watch what goes wrong in a_Http_make_query_str()?
Between this and the file path thing, I wonder whether irix
doesn't like that va_list/va_copy/vsnprintf stuff in the dStr
code in dlib/dlib.c.
I had a brief look at the dlib code. I don't think it's a problem with
the va stuff. I have one warning when compiling dlib.c:

/usr/nekoware/gcc-4.7/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I..
-I/usr/local/include -I/usr/nekoware/include
-I/usr/nekoware/gcc-4.7/include/c++/4.7.1 -I/usr/local/include
-mtune=r5000 -mips4 -mabi=n32 -DD_DNS_THREADED -D_REENTRANT
-D_THREAD_SAFE -Wall -W -Wno-unused-parameter -Waggregate-return -MT
dlib.o -MD -MP -MF .deps/dlib.Tpo -c -o dlib.o dlib.c
dlib.c: In function 'dStr_printable':
dlib.c:514:7: warning: array subscript has type 'char' [-Wchar-subscripts]
mv -f .deps/dlib.Tpo .deps/dlib.Po
rm -f libDlib.a
ar cru libDlib.a dlib.o
: libDlib.a

This is the line:

if (isprint(in->str[i]) || (in->str[i] == '\n')) {

isprintf is defined in Irix

extern int isprint(int);
eocene
2014-04-10 21:49:12 UTC
Permalink
Post by Jan Diegelmann
I had a brief look at the dlib code. I don't think it's a problem
/usr/nekoware/gcc-4.7/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I..
-I/usr/local/include -I/usr/nekoware/include
-I/usr/nekoware/gcc-4.7/include/c++/4.7.1 -I/usr/local/include
-mtune=r5000 -mips4 -mabi=n32 -DD_DNS_THREADED -D_REENTRANT
-D_THREAD_SAFE -Wall -W -Wno-unused-parameter -Waggregate-return -MT
dlib.o -MD -MP -MF .deps/dlib.Tpo -c -o dlib.o dlib.c
dlib.c:514:7: warning: array subscript has type 'char' [-Wchar-subscripts]
mv -f .deps/dlib.Tpo .deps/dlib.Po
rm -f libDlib.a
ar cru libDlib.a dlib.o
: libDlib.a
if (isprint(in->str[i]) || (in->str[i] == '\n')) {
isprintf is defined in Irix
extern int isprint(int);
The subscript 'i'?
Jan Diegelmann
2014-04-11 07:06:17 UTC
Permalink
Post by eocene
Post by Jan Diegelmann
I had a brief look at the dlib code. I don't think it's a problem
/usr/nekoware/gcc-4.7/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I..
-I/usr/local/include -I/usr/nekoware/include
-I/usr/nekoware/gcc-4.7/include/c++/4.7.1 -I/usr/local/include
-mtune=r5000 -mips4 -mabi=n32 -DD_DNS_THREADED -D_REENTRANT
-D_THREAD_SAFE -Wall -W -Wno-unused-parameter -Waggregate-return -MT
dlib.o -MD -MP -MF .deps/dlib.Tpo -c -o dlib.o dlib.c
dlib.c:514:7: warning: array subscript has type 'char' [-Wchar-subscripts]
mv -f .deps/dlib.Tpo .deps/dlib.Po
rm -f libDlib.a
ar cru libDlib.a dlib.o
: libDlib.a
if (isprint(in->str[i]) || (in->str[i] == '\n')) {
isprintf is defined in Irix
extern int isprint(int);
The subscript 'i'?
int i;

it's defined in the function dStr_printable:

/*
* Return a printable representation of the provided Dstr, limited to a
length
* of roughly maxlen.
*
* This is NOT threadsafe.
*/
const char *dStr_printable(Dstr *in, int maxlen)
{
int i;
static const char *const HEX = "0123456789ABCDEF";
static Dstr *out = NULL;

if (in == NULL)
return NULL;

if (out)
dStr_truncate(out, 0);
else
out = dStr_sized_new(in->len);

for (i = 0; (i < in->len) && (out->len < maxlen); ++i) {
if (isprint(in->str[i]) || (in->str[i] == '\n')) {
dStr_append_c(out, in->str[i]);
} else {
dStr_append_l(out, "\\x", 2);
dStr_append_c(out, HEX[(in->str[i] >> 4) & 15]);
dStr_append_c(out, HEX[in->str[i] & 15]);
}
}
if (out->len >= maxlen)
dStr_append(out, "...");
return out->str;
}
eocene
2014-04-11 14:33:29 UTC
Permalink
Post by Jan Diegelmann
Post by eocene
The subscript 'i'?
int i;
Is it awkwardly trying to complain that it's signed?
eocene
2014-09-15 20:46:03 UTC
Permalink
Post by eocene
Post by eocene
Post by Jan Diegelmann
Post by eocene
Post by Jan Diegelmann
Query: {GE}
a_IO_ccc : OpSend [1B] Info=10262f30 Flags=0
"GE" is the entire query?
Yes exactly. Any idea?
Can you watch what goes wrong in a_Http_make_query_str()?
Between this and the file path thing, I wonder whether irix
doesn't like that va_list/va_copy/vsnprintf stuff in the dStr
code in dlib/dlib.c.
It did turn out to be irix's idea of vsnprintf().

Modifying dStr_vsprintfa(), I browsed around for a few minutes
without problems.

Now to look into how to solve this properly...
eocene
2014-09-16 06:29:27 UTC
Permalink
In the typical vsnprintf() (i.e., following the c99 standard), if you
have space for 10 bytes and you want to write 20 bytes (including '\0'),
you return 19, whereas irix returns 9.

Some options:

1. It's possible to make irix and the standard run with a change like

diff -r 5f63e28334b2 dlib/dlib.c
--- a/dlib/dlib.c Tue Sep 16 00:21:49 2014 +0000
+++ b/dlib/dlib.c Tue Sep 16 04:59:20 2014 +0000
@@ -406,11 +406,11 @@
va_copy(argp2, argp);
n = vsnprintf(ds->str + ds->len, ds->sz - ds->len, format, argp2);
va_end(argp2);
- if (n > -1 && n < ds->sz - ds->len) {
+ if (n > -1 && n+1 < ds->sz - ds->len) {
ds->len += n; /* Success! */
break;
} else if (n > -1) { /* glibc >= 2.1 */
- n_sz = ds->len + n + 1;
+ n_sz = ds->len + n + 2;
} else { /* old glibc */
n_sz = ds->sz * 2;
}

...although it would need tweaking to waste less running time.

But of course even if dillo is partly about retrocomputing, it'll be
99% linux+bsd retrocomputing and 1% other-stuff retrocomputing, so...

2. Throw an ifdef at it. Dillo has never had many ifdefs, and I'd thought
they were discouraged, but maybe the changes needed for all of that stuff
at the bottom of Compatibility.html like

SGI O2 running IRIX
Tru64 (OSF1) 4.0 on Alpha
QNX RTP 6.1/x86 (with occasional memory faults out of GTK+)
AIX 4.3 (with some tweaks)
Atari-based 68k-systems running MiNT
Microsoft Windows using Cygwin
RISC OS

...just didn't make it back into mainline dillo1?

3. We could always borrow fltk's vsnprintf(), which is about 250 lines.


I lean toward giving it an ifdef.


--------------

Extra verbiage:

Autoconf's manual says:
The C99 standard says that if the output array isn't big enough and if no other errors occur, snprintf and vsnprintf truncate the output and return the number of bytes that ought to have been produced. Some older systems return the truncated length (e.g., GNU C Library 2.0.x or IRIX 6.5), some a negative value (e.g., earlier GNU C Library versions), and some the buffer length without truncation (e.g., 32-bit Solaris 7). Also, some buggy older systems ignore the length and overrun the buffer (e.g., 64-bit Solaris 7).

glibc-2.1: 1999
solaris 7: 1998
irix 6.5: major release 1998
regular minor releases until 2005
"The last version of IRIX was 6.5.30, released in August 2006."
Jan Diegelmann
2014-09-16 09:31:48 UTC
Permalink
Post by eocene
1. It's possible to make irix and the standard run with a change like
dilo 3.0.4 works fine with your pach on Irix. Thank you very much for
your help!
Post by eocene
I lean toward giving it an ifdef.
I would also be happy to maintain a patch for Irix dillo. In this case
you should make some notes in the README file.
eocene
2014-09-16 17:42:39 UTC
Permalink
Post by Jan Diegelmann
Post by eocene
1. It's possible to make irix and the standard run with a change like
dilo 3.0.4 works fine with your pach on Irix. Thank you very much
for your help!
It would also be nice to deal with the other issues if possible.
- You said you had to comment out a setenv, iirc?
- I had to fix up src/Makefile in a small way which maybe could be avoided.
Johannes Hofmann
2014-09-16 10:32:25 UTC
Permalink
Post by eocene
In the typical vsnprintf() (i.e., following the c99 standard), if you
have space for 10 bytes and you want to write 20 bytes (including '\0'),
you return 19, whereas irix returns 9.
1. It's possible to make irix and the standard run with a change like
diff -r 5f63e28334b2 dlib/dlib.c
--- a/dlib/dlib.c Tue Sep 16 00:21:49 2014 +0000
+++ b/dlib/dlib.c Tue Sep 16 04:59:20 2014 +0000
@@ -406,11 +406,11 @@
va_copy(argp2, argp);
n = vsnprintf(ds->str + ds->len, ds->sz - ds->len, format, argp2);
va_end(argp2);
- if (n > -1 && n < ds->sz - ds->len) {
+ if (n > -1 && n+1 < ds->sz - ds->len) {
ds->len += n; /* Success! */
break;
} else if (n > -1) { /* glibc >= 2.1 */
- n_sz = ds->len + n + 1;
+ n_sz = ds->len + n + 2;
} else { /* old glibc */
n_sz = ds->sz * 2;
}
...although it would need tweaking to waste less running time.
But of course even if dillo is partly about retrocomputing, it'll be
99% linux+bsd retrocomputing and 1% other-stuff retrocomputing, so...
2. Throw an ifdef at it. Dillo has never had many ifdefs, and I'd thought
they were discouraged, but maybe the changes needed for all of that stuff
at the bottom of Compatibility.html like
SGI O2 running IRIX
Tru64 (OSF1) 4.0 on Alpha
QNX RTP 6.1/x86 (with occasional memory faults out of GTK+)
AIX 4.3 (with some tweaks)
Atari-based 68k-systems running MiNT
Microsoft Windows using Cygwin
RISC OS
...just didn't make it back into mainline dillo1?
3. We could always borrow fltk's vsnprintf(), which is about 250 lines.
I lean toward giving it an ifdef.
I would suggest testing for this specific (v)snprintf() behaviour in
configure and ifdef based on the result rather than on the OS.
There might even be some builtin support for this check in autoconf
as the issue is mentioned in [1].

Johannes

[1] https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Function-Portability.html
eocene
2014-09-16 17:49:26 UTC
Permalink
Post by Johannes Hofmann
I would suggest testing for this specific (v)snprintf() behaviour in
configure and ifdef based on the result rather than on the OS.
I thought about that, and between
- it sounding like Irix == this behaviour
and
- relearning enough about autoconf to do anything is always somewhere
between unpleasant and painful
I felt disinclined, but I could give it some effort.
Post by Johannes Hofmann
There might even be some builtin support for this check in autoconf
as the issue is mentioned in [1].
I looked a bit yesterday and didn't get the impression that there
was anything.
Johannes Hofmann
2014-09-16 20:50:23 UTC
Permalink
Post by eocene
Post by Johannes Hofmann
I would suggest testing for this specific (v)snprintf() behaviour in
configure and ifdef based on the result rather than on the OS.
I thought about that, and between
- it sounding like Irix == this behaviour
and
- relearning enough about autoconf to do anything is always somewhere
between unpleasant and painful
I felt disinclined, but I could give it some effort.
Post by Johannes Hofmann
There might even be some builtin support for this check in autoconf
as the issue is mentioned in [1].
I looked a bit yesterday and didn't get the impression that there
was anything.
AX_FUNC_SNPRINTF might help. It worked on my system after I
installed an autoconf-archive package.
Here is some documentation:
http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_func_snprintf.m4
I think it will define PREFER_PORTABLE_SNPRINTF in config.h in case
it detects a broken (v)snprintf().
Jorge Arellano Cid
2014-09-18 15:44:33 UTC
Permalink
Post by eocene
In the typical vsnprintf() (i.e., following the c99 standard), if you
have space for 10 bytes and you want to write 20 bytes (including '\0'),
you return 19, whereas irix returns 9.
1. It's possible to make irix and the standard run with a change like
diff -r 5f63e28334b2 dlib/dlib.c
--- a/dlib/dlib.c Tue Sep 16 00:21:49 2014 +0000
+++ b/dlib/dlib.c Tue Sep 16 04:59:20 2014 +0000
@@ -406,11 +406,11 @@
va_copy(argp2, argp);
n = vsnprintf(ds->str + ds->len, ds->sz - ds->len, format, argp2);
va_end(argp2);
- if (n > -1 && n < ds->sz - ds->len) {
+ if (n > -1 && n+1 < ds->sz - ds->len) {
ds->len += n; /* Success! */
break;
} else if (n > -1) { /* glibc >= 2.1 */
- n_sz = ds->len + n + 1;
+ n_sz = ds->len + n + 2;
} else { /* old glibc */
n_sz = ds->sz * 2;
}
...although it would need tweaking to waste less running time.
But of course even if dillo is partly about retrocomputing, it'll be
99% linux+bsd retrocomputing and 1% other-stuff retrocomputing, so...
2. Throw an ifdef at it. Dillo has never had many ifdefs, and I'd thought
they were discouraged, but maybe the changes needed for all of that stuff
at the bottom of Compatibility.html like
SGI O2 running IRIX
Tru64 (OSF1) 4.0 on Alpha
QNX RTP 6.1/x86 (with occasional memory faults out of GTK+)
AIX 4.3 (with some tweaks)
Atari-based 68k-systems running MiNT
Microsoft Windows using Cygwin
RISC OS
...just didn't make it back into mainline dillo1?
3. We could always borrow fltk's vsnprintf(), which is about 250 lines.
I lean toward giving it an ifdef.
Me too, it clearly is an IRIX issue and the #ifdef would make it
cristal clear (compared to a soln. using fltk's vsnprintf() for
instance).

+1
--
Cheers
Jorge.-
Jorge Arellano Cid
2014-09-18 16:46:06 UTC
Permalink
Post by Jorge Arellano Cid
Post by eocene
In the typical vsnprintf() (i.e., following the c99 standard), if you
have space for 10 bytes and you want to write 20 bytes (including '\0'),
you return 19, whereas irix returns 9.
1. It's possible to make irix and the standard run with a change like
diff -r 5f63e28334b2 dlib/dlib.c
--- a/dlib/dlib.c Tue Sep 16 00:21:49 2014 +0000
+++ b/dlib/dlib.c Tue Sep 16 04:59:20 2014 +0000
@@ -406,11 +406,11 @@
va_copy(argp2, argp);
n = vsnprintf(ds->str + ds->len, ds->sz - ds->len, format, argp2);
va_end(argp2);
- if (n > -1 && n < ds->sz - ds->len) {
+ if (n > -1 && n+1 < ds->sz - ds->len) {
ds->len += n; /* Success! */
break;
} else if (n > -1) { /* glibc >= 2.1 */
- n_sz = ds->len + n + 1;
+ n_sz = ds->len + n + 2;
} else { /* old glibc */
n_sz = ds->sz * 2;
}
...although it would need tweaking to waste less running time.
But of course even if dillo is partly about retrocomputing, it'll be
99% linux+bsd retrocomputing and 1% other-stuff retrocomputing, so...
2. Throw an ifdef at it. Dillo has never had many ifdefs, and I'd thought
they were discouraged, but maybe the changes needed for all of that stuff
at the bottom of Compatibility.html like
SGI O2 running IRIX
Tru64 (OSF1) 4.0 on Alpha
QNX RTP 6.1/x86 (with occasional memory faults out of GTK+)
AIX 4.3 (with some tweaks)
Atari-based 68k-systems running MiNT
Microsoft Windows using Cygwin
RISC OS
...just didn't make it back into mainline dillo1?
3. We could always borrow fltk's vsnprintf(), which is about 250 lines.
I lean toward giving it an ifdef.
Me too, it clearly is an IRIX issue and the #ifdef would make it
cristal clear (compared to a soln. using fltk's vsnprintf() for
instance).
+1
A bit more elaboration:

I'd add an my_vsnprintf() in dlibc and make dStr_vsprintfa() use it,
and make it like:

my_vsnprintf()
{
#if IRIX
/* compute required length by using IRIX's rules */
#else
/* use vsnprintf(), no problem */
#fi
}

To avoid autoconf, the IRIX test can be placed in the same
function with a static int:

static int IRIX = -1;
if (IRIX == -1) {
/* very simple snprintf() test here */
IRIX = test ? 1 : 0;
}
--
Cheers
Jorge.-
eocene
2014-09-19 03:00:01 UTC
Permalink
Having thought about it probably too much over the past however many days,
I haven't thought of a good reason not to stick it all in an ifdef like

#if defined(__sgi)
/* IRIX does not conform to C99; if the entire argument did not fit
* into the buffer, n = buffer space used (minus 1 for terminator)
*/
if (n > -1 && n + 1 < ds->sz - ds->len) {
ds->len += n; /* Success! */
break;
} else {
n_sz = ds->sz * 2;
}
#else
if (n > -1 && n < ds->sz - ds->len) {
ds->len += n; /* Success! */
break;
} else if (n > -1) { /* glibc >= 2.1 */
n_sz = ds->len + n + 1;
} else { /* old glibc */
n_sz = ds->sz * 2;
}
#endif

and be done with it.
Jorge Arellano Cid
2014-09-19 15:52:50 UTC
Permalink
Post by eocene
Having thought about it probably too much over the past however many days,
I haven't thought of a good reason not to stick it all in an ifdef like
#if defined(__sgi)
/* IRIX does not conform to C99; if the entire argument did not fit
* into the buffer, n = buffer space used (minus 1 for terminator)
*/
if (n > -1 && n + 1 < ds->sz - ds->len) {
ds->len += n; /* Success! */
break;
} else {
n_sz = ds->sz * 2;
}
#else
if (n > -1 && n < ds->sz - ds->len) {
ds->len += n; /* Success! */
break;
} else if (n > -1) { /* glibc >= 2.1 */
n_sz = ds->len + n + 1;
} else { /* old glibc */
n_sz = ds->sz * 2;
}
#endif
and be done with it.
Fair enough, and IMHO simpler than my proposal.

+1
--
Cheers
Jorge.-
eocene
2014-09-24 23:46:31 UTC
Permalink
On IRIX, dpid starts but use of the dpis fails with
"Dpi_get_server_port: can't read server port from dpid."

Jorge, do you have any time to look into that?

Jorge Arellano Cid
2014-04-07 17:49:27 UTC
Permalink
Post by Jan Diegelmann
Post by eocene
Post by Jan Diegelmann
Query: {GE}
a_IO_ccc : OpSend [1B] Info=10262f30 Flags=0
"GE" is the entire query?
Yes exactly. Any idea?
Yes, that sould be a full HTTP protocol request!

Something went wrong before that point.
--
Cheers
Jorge.-
Chris Sorenson
2014-09-16 20:05:49 UTC
Permalink
Post by eocene
Post by Johannes Hofmann
There might even be some builtin support for this check
in autoconf as the issue is mentioned in [1].
I looked a bit yesterday and didn't get the impression
that there was anything.
There is an autoconf m4 macro for snprintf, with some IRIX
specific checks, here:

http://www.jhweiss.de/software/snprintf.html

According to that page versions of IRIX all the way up to
the present (6.5.30) don't adhere to the standard.

For what it's worth this is the IRIX online manual page for
snprintf():

http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=man&fname=/usr/share/catman/p_man/cat3s/snprintf.z&srch=snprintf
Chris Sorenson
2014-09-19 19:07:06 UTC
Permalink
Post by eocene
#if defined(__sgi)
This will work with the MIPSPro compiler but I'm pretty sure
the GNU compilers do not #define __sgi
eocene
2014-09-19 19:43:01 UTC
Permalink
Post by Chris Sorenson
Post by eocene
#if defined(__sgi)
This will work with the MIPSPro compiler but I'm pretty sure
the GNU compilers do not #define __sgi
On Jan's machine,

./cpp --version
cpp (GCC) 4.7.1

./cpp -dM |grep __sgi
#define __sgi 1
#define __sgi__ 1
Jan Diegelmann
2014-09-19 20:25:32 UTC
Permalink
The gcc on my machine is the nekoware gcc 4.7.1 compiled by
shadeofblue. It is the standard gcc for Irix currently. If __sgi is true
it is really a SGI system.
Post by eocene
Post by Chris Sorenson
Post by eocene
#if defined(__sgi)
This will work with the MIPSPro compiler but I'm pretty sure
the GNU compilers do not #define __sgi
On Jan's machine,
./cpp --version
cpp (GCC) 4.7.1
./cpp -dM |grep __sgi
#define __sgi 1
#define __sgi__ 1
_______________________________________________
Dillo-dev mailing list
http://lists.dillo.org/cgi-bin/mailman/listinfo/dillo-dev
--
Jan Diegelmann

email: diegel-***@public.gmane.org
fon: +49 40 238 809 15
fax: +49 40 238 809 29

http://www.work.de : ***@work Internet Informationssyteme GmbH
Wandalenweg 5, 20097 Hamburg, Germany
HR B 61668 - Amtsgericht Hamburg
Geschäftsführer: Jan Diegelmann
Chris Sorenson
2014-09-19 20:42:28 UTC
Permalink
I stand corrected! 0_o

Thanks guys... :)
Post by Jan Diegelmann
The gcc on my machine is the nekoware gcc 4.7.1
compiled by shadeofblue. It is the standard gcc
for Irix currently. If __sgi is true it is really
a SGI system.
Post by eocene
Post by eocene
#if defined(__sgi)
This will work with the MIPSPro compiler but
I'm pretty sure the GNU compilers do not
#define __sgi
On Jan's machine,
./cpp --version
cpp (GCC) 4.7.1
./cpp -dM |grep __sgi
#define __sgi 1
#define __sgi__ 1
Loading...