SGI: Development

undefined identifier : SIAG - Page 1

Anybody got a quick hint ? I was trying to make SIAG work, just for the heck of it ...
[code]
cc-1020 cc: ERROR File = MwFilesel.c, Line = 693
The identifier "PATH_MAX" is undefined.

char newpath[PATH_MAX];
^
[/code

edit : added SIAG to the title for future reference

_________________
waiting for flight 1203 ...
Just define it or look where it is defined:

find /usr/include -exec fgrep PATH_MAX {} \; -print

At my system it is defined in /usr/include/internal/limits_core.h

_________________
:Tezro: :Fuel: :Octane2: :Octane: :Onyx2: :O2+: :O2: :Indy: :Indigo: :Cube:
Obviously, you shouldn't include stuff from internal/ directly, so
Code:
$ grep -r limits_core.h /usr/include/
/usr/include/CC/climits:#include <internal/limits_core.h>
/usr/include/limits.h:#include <internal/limits_core.h>

While you're there, check the man page for limits
canavan wrote:
While you're there, check the man page for limits

Got past that error with a simple #include<limits.h> which seemed to work thank you (i hope) but moving right along ...
Code:
cc-1020 cc: ERROR File = /usr/include/sys/vnode.h, Line = 375
The identifier "mprot_t" is undefined.

typedef       int     (*vop_map_t)(bhv_desc_t *, off_t, size_t, mprot_t, u_int,
^

cc-1020 cc: ERROR File = /usr/include/sys/vnode.h, Line = 378
The identifier "mprot_t" is undefined.

pgno_t *, off_t, size_t, mprot_t,
^

Okay, I give up. If

typedef int (*vop_map_t)(bhv_desc_t *, off_t, size_t, mprot_t, u_int,

doesn't define mprot_t what is needed to define it ? This is what I get from diegel's helpful searchment suggestion :

Code:
urchin 1% find /usr/include -exec fgrep mprot_t {} \; -print
off_t, size_t, mprot_t, struct cred *,
/usr/include/sys/fs/spec_ops.h
mprot_t, u_int, struct cred *, vnode_t **);
mprot_t, struct cred *);
/usr/include/sys/pvnode.h
typedef uchar_t mprot_t;                /* memory protections (PROT_*) */
/usr/include/sys/types.h
typedef int     (*vop_map_t)(bhv_desc_t *, off_t, size_t, mprot_t, u_int,
pgno_t *, off_t, size_t, mprot_t,
/usr/include/sys/vnode.h
fgrep: /usr/include/X11/Xirisw: No such file or directory
fgrep: /usr/include/X11/uil: No such file or directory
fgrep: /usr/include/uil: No such file or directory

(Another puzzle is why we are searching directories that don't exist ... something told fgrep to look there and it wasn't me :shock: )

_________________
waiting for flight 1203 ...
hi ham, maybe you already found this but just in case ;)

http://forums.nekochan.net/viewtopic.php?f=15&t=16720734

_________________
:Octane: (Sakura) :O2: (Sasuke) :1600SW: (Naruto) ... lil Jesse! (O2 laptop)
“Imagination is more important than knowledge.“ – A. Einstein
geo wrote:
hi ham, maybe you already found this but just in case ;)

http://forums.nekochan.net/viewtopic.php?f=15&t=16720734

Good catch, geo ! Thank you. I'll go wake up SAQ, see if he ever found a solution.

_________________
waiting for flight 1203 ...
did you try to include sys/types.h in the file in question?
foetz wrote:
did you try to include sys/types.h in the file in question?

Seems to be
Code:

/* start of Siag-specific attempts to make this module more portable */

#include "../config.h"

#ifndef unix
#define unix
#endif
#ifndef __USE_XOPEN
#define __USE_XOPEN
#endif

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <setjmp.h>
#include <signal.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <errno.h>
#include <stdarg.h>
#include <limits.h>

#include <unistd.h>
#include <dirent.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <pwd.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <grp.h>
#include <utime.h>
#include <sys/fcntl.h>

#ifndef PATH_MAX
#define PATH_MAX 1024
#endif

#ifdef HAVE_SYS_MODE_H
#include <sys/mode.h>
#endif
#ifdef HAVE_FNMATCH_H
#include <fnmatch.h>
#endif
#ifdef HAVE_CRYPT_H
#include <crypt.h>
#endif
#ifdef HAVE_SYS_MKDEV_H
#include <sys/mkdev.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif


#include "siod.h"
#include "siodp.h"
#include "md5.h"

buit this puzzles me (yeah I know, so does a shiny rock)
Code:
cc-1020 cc: ERROR File = /usr/include/sys/vnode.h, Line = 378
The identifier "mprot_t" is undefined.

pgno_t *, off_t, size_t, mprot_t,
^

This error is about a system header while most errors and warnings are about the C code itself ...
Code:
cc-1552 cc: WARNING File = slibu.c, Line = 239
The variable "status" is set but never used.

int status;
^

and these are the lines in slibu.c that are kicking off the error codes in /usr/include/sys/vnode.h :
Code:
(375)   {int iflag;
(376)    char **argv = NULL, **envp = NULL;
(377)    LISP gcsafe=NIL;
(378)    iflag = no_interrupt(1);


aah, sweet mysteries of C at last I've found you ... :shock:

_________________
waiting for flight 1203 ...
try moving it up in the include list or copy the parts you need from the include file and copy them in the affected files.
foetz wrote:
try moving it up in the include list

tried that, no help :(
Quote:
or copy the parts you need from the include file and copy them in the affected files.

trying now ..... but that thing about the error being in the system includes rather than the source code doesn't seem right ... :(

_________________
waiting for flight 1203 ...
hamei wrote:
that thing about the error being in the system includes rather than the source code doesn't seem right ... :(

yeah, however under certain circumstances that can happen even if the files are not wrong per se. i encountered that on different operating systems in the past
I took a quick look at sys/types.h (from IRIX 6.5.22), and it looks like mprot_t is only defined in an #ifdef block for kernel code. Two things you could try are:

1) Add -D_KMEMUSER to your CPPFLAGS or CFLAGS (although that may break other stuff)

2) Add -Dmprot_t=uchar_t to your CPPFLAGS (since that's essentially what sys/types.h is doing)

Either of those might help, but both suggestions are untested. None of my IRIX boxes are up and running at the moment.

_________________
:Indigo2IMP: :Octane: :Indigo: :O3x0:
Sun SPARCstation 20, Blade 2500
HP C8000
jpstewart wrote:
2) Add -Dmprot_t=uchar_t to your CPPFLAGS (since that's essentially what sys/types.h is doing)

I tried Door Number Two first, since you said the other option could possibly break other stuff and ... yay ! It worked.

Thank you.

I feel like Job ... no, not that Jobs, the other one ... whatever happened to a thousand eyes, a thousand hands ? These programs are ten years old, nobody ever found these problems before ?

Code:
cc-1029 cc: ERROR File = xsiag.c, Line = 142
An expression is expected at this point.

};
^

cc-3940 cc: ERROR File = xsiag.c, Line = 131
an empty initializer is invalid for an array with unspecified bound

static XtActionsRec actions[] =
^

I tired removing the semicolon .. that was a mistake :D Saw a few new warnings, too ... it went by too fast to read thoroughly but I liked the one about WARNING: da da da, dit dit looks suspicious ...

The array of unspecified bounds seems to be a gcc-ism : no one else in the world allows that, ahem. Didn't find an easy fix tho ... the missing expression ERROR occurs here;

Code:
static XtActionsRec actions[] =
{
#ifdef HAVE_LIBGUILE
{"guile", execute_guile_action},
#endif
#if 0
{"execute", execute_siod_action},
#endif
#ifdef HAVE_LIBTCL
{"tcl", execute_tcl_action}
#endif
};


I will go back to tardistting Ted now while awaiting further instructions .... SIAG looks interesting if we can ever get it to run (that's the royal we - you do the work, I push the buttons)

_________________
waiting for flight 1203 ...
hamei wrote:
Code:
cc-1029 cc: ERROR File = xsiag.c, Line = 142
An expression is expected at this point.

};
^

cc-3940 cc: ERROR File = xsiag.c, Line = 131
an empty initializer is invalid for an array with unspecified bound

static XtActionsRec actions[] =
^

I tired removing the semicolon .. that was a mistake :D Saw a few new warnings, too ... it went by too fast to read thoroughly but I liked the one about WARNING: da da da, dit dit looks suspicious ...


The semicolon does need to be there, the compiler is just complaining that hey donut! You're supposed to put something sensible in before that!

hamei wrote:
The array of unspecified bounds seems to be a gcc-ism : no one else in the world allows that, ahem. Didn't find an easy fix tho ... the missing expression ERROR occurs here;

Code:
static XtActionsRec actions[] =
{
#ifdef HAVE_LIBGUILE
{"guile", execute_guile_action},
#endif
#if 0
{"execute", execute_siod_action},
#endif
#ifdef HAVE_LIBTCL
{"tcl", execute_tcl_action}
#endif
};



I can't reproduce the "unspecified bounds" with test code, perhaps your cc is slightly smarter than the version I have, or XtActionsRec is declared differently than I guessed. 7.4.2m just says that the type is incomplete.

If neither HAVE_LIBGUILE or HAVE_LIBTCL (0 is always false of course) is declared though you end up with...

Code:
static XtActionsRec actions[] =
{
};


...which is an empty initialisation which MIPSpro does not like at all. Either remove/ifdef the initialisation in entirety or add something harmless in it. (What, depends on the code using it, normally you'd have something like {"end", NULL} or whatever to facilitate looping over the contents. I'm guessing but this code might have ifdefs around its usages instead and that means you could probably just put whatever you like so long as the first value isn't "tcl", "guile" or "execute".)

_________________
:Octane: halo , oct ane
N.B.: I tend to talk out of my ass. Do not take it too seriously.
duck wrote:
Either remove/ifdef the initialisation in entirety or add something harmless in it.

I'm not entirely happy with this :
Code:
static XtActionsRec actions [] =
{
#ifdef HAVE_LIBGUILE
{"guile", execute_guile_action},
#endif

#ifdef HAVE_LIBTCL
{"tcl", execute_tcl_action}
#endif

#if 0
{"execute", execute_siod_action},
#endif

{"unspeakable_profanity", NULL}
};

It seems like all he's trying to do is choose some action according to whether one has Tickle and/or Guile installed but this did seem to make the compiler continue. So for now ...

This thing is giving me a headache :
Code:
cc-1117 cc: ERROR File = matrix.c, Line = 845
An expression appears after a "return" in a "void" function.

return unpack_string_area(buf, data, s, row, col);
^

1 error detected in the compilation of "matrix.c".


c99 standard wrote:
6.8.6.4 The return statement

Constraints

A return statement with an expression shall not appear in a function whose return type is void. A return statement without an expression shall only appear in a function whose return type is void.

Apparently MIPSpro is behaving like a good boy while SIAG is not :( I'd prefer not to back up to c89, that doesn't seem like the correct thing to do ? "Undefined" does not sound like a good thing ..

Do they still make analog computers ?

_________________
waiting for flight 1203 ...
hamei wrote:
This thing is giving me a headache :
Code:
cc-1117 cc: ERROR File = matrix.c, Line = 845
An expression appears after a "return" in a "void" function.

return unpack_string_area(buf, data, s, row, col);
^

1 error detected in the compilation of "matrix.c".




Oh, that's rich. unpack_string_area is also returning void, so you can see how they intended it to work. Saves a line!

just...

Code:
unpack_string_area(buf, data, s, row, col);
return;


...ougt to do the same thing. If it's the last line of the function, you don't even need the return statement.

_________________
:Octane: halo , oct ane
N.B.: I tend to talk out of my ass. Do not take it too seriously.
duck wrote:
just...
Code:
unpack_string_area(buf, data, s, row, col);
return;

...ought to do the same thing. If it's the last line of the function, you don't even need the return statement.


Wull, ah'll be a monkey's uncle ... we run outta code for him to do weird stuff with. Ta-daaa :D
Attachment:
siag-irix.jpg
siag-irix.jpg [ 252.8 KiB | Viewed 374 times ]

Looks like I've got enough stuff to keep me busy for a month tardistting ... A big thank-you to everyone who gave directions and didn't laugh at the stupid questions. Not publicly, anyhow :P

_________________
waiting for flight 1203 ...
duck wrote:
Oh, that's rich. unpack_string_area is also returning void, so you can see how they intended it to work. Saves a line!

terrific :twisted:

hamei wrote:
Looks like I've got enough stuff to keep me busy for a month tardistting ... A big thank-you to everyone who gave directions and didn't laugh at the stupid questions. Not publicly, anyhow :P

ha congrats! great to have one more addition to the arsenal, especially one that's not plug & play.

what window manager is that btw? looks sort of wrong lol
foetz wrote:
what window manager is that btw? looks sort of wrong lol

Everything about this is sort of wrong :D It has several "themes", one is CDE but I haven't tried that. This is the default look.

However ... it is a spreadsheet, it does work in Irix, it does have some interesting features ?
Attachment:
siags.jpg
siags.jpg [ 210.35 KiB | Viewed 339 times ]

It is one of the more peculiar programs I've run across but here's to individuality (glasses clinking emoticon goes here) ... it's the only program I've had that refused to link in the <gmake install> phase, apparently it wants GhostView and I've already polluted my computer too much with this thing, I amn't gonna do that.

Pathetic Writer really is, Ted is much more useful (except the superscript, subscript buttons are kind of neat).

But, maybe someone will like it, it's a starting place, the spreadsheet and Scheme and Guile integration might be good, I can stick it into a package forever intended to be /beta so that if someone wants to mess with it, at least some of the work is done ?

Thinking about that tho, it probably doesn't belong in /nekoware because it's def experimental .. where should it go ? /usr/local with the other trash ? :P Or just make a tardist of what's done and let people do whatever ? Not everyone has a compiler :(

_________________
waiting for flight 1203 ...
Managed to stamp out another couple of goofy problems, now it all works. Or I think it works, some of the plugins are rather unusual ... the spreadsheet might be worth something tho. It imports Excel spreadsheets. (That's an import on the back page.) No idea how accurately but at least for what most people use spreadshits for, it should be okay. Has a list of application settings you can change about a mile long. Don't we have a LISP fanatic here ? It uses Scheme which is a variation on LISP, yes ? If someone split off the pathetic writer and other ... errr ... dated auxiliaries (the file manager is a true relic !) it might be handy as a spreadsheet. It's a pretty impressive achievement for a single person, even if it is kind of strange.

Anyway, the more software the better, right ? thousands and thousands of apps in the nekostore :P
Attachment:
more_siag.jpg
more_siag.jpg [ 159.53 KiB | Viewed 314 times ]

_________________
waiting for flight 1203 ...