[GRASS5] What is ESRCH?

Hi developers,

due to user's request I found the following problem:

The C-code defines ESRCH in some files:

src/libes/raster > grep ESRCH *
io.c: return errno != ESRCH;
new_io.c: return errno != ESRCH;

but a few compiler do not know this "ESRCH".
How can I help/change ESRCH to some value?

Regards

   Markus

----------------------------------------
If you want to unsubscribe from GRASS Development
Team internal mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'
length: 855
max: 0

On Mon, 17 Apr 2000, Markus Neteler wrote:

The C-code defines ESRCH in some files:

src/libes/raster > grep ESRCH *
io.c: return errno != ESRCH;
new_io.c: return errno != ESRCH;

but a few compiler do not know this "ESRCH". How can I help/change ESRCH
to some value?

Markus,

  Did you rgrep in the header files for the definition?

Rich

Dr. Richard B. Shepard, President

                       Applied Ecosystem Services, Inc. (TM)
              Making environmentally-responsible mining happen. (SM)
                       --------------------------------
            2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A.
+ 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | rshepard@appl-ecosys.com

----------------------------------------
If you want to unsubscribe from GRASS Development
Team internal mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'
length: 1702
max: 0

Dear developers,

another own compile problem I have with
r.binfer/Linux.

I have two different platforms running Linux.

A definition in:
src/raster/r.binfer/binfer.l
is causing problems.

[row 39]

#ifndef sparc
#ifndef linux
int yylineno = 1;
#endif
#endif

On machine one above compiles, on machine two I get
binfer.l: In function 'yylex':
binfer.l:114: 'yylineno' undeclared (first use in this function)
binfer.l:114: (Each undeclared identifier is reported only once
binfer.l:114: for each function it appears in.)
make: *** [OBJ.i586-linux-elf/lex.o] Error 1

It is quite strange. Any ideas?

If using:
#ifndef sparc
int yylineno = 1;
#endif

machine 1 likes it, machine 2 says: 'yylineno' undeclared.

I don't know how to declare yylineno properly. I need a better
#ifdef condition sensitive for something else that "linux".

This shall be the final bugfix before GRASS 5 beta7 can be
released :slight_smile:

Best regards

Markus

--
Dipl.-Geogr. Markus Neteler * University of Hannover
Institute of Physical Geography and Landscape Ecology
Schneiderberg 50 * D-30167 Hannover * Germany
Tel: ++49-(0)511-762-4494 Fax: -3984

----------------------------------------
If you want to unsubscribe from GRASS Development
Team internal mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'
length: 1882
max: 0

Markus Neteler wrote:

Hi developers,

due to user's request I found the following problem:

The C-code defines ESRCH in some files:

src/libes/raster > grep ESRCH *
io.c: return errno != ESRCH;
new_io.c: return errno != ESRCH;

but a few compiler do not know this "ESRCH".
How can I help/change ESRCH to some value?

Regards

   Markus

----------------------------------------
If you want to unsubscribe from GRASS Development
Team internal mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'
length: 855
max: 0

Hi Markus,

ESRCH is POSIX.1 and defined in sys/errno.h on most standardized
systems.
On IRIX: errno.h:#define ESRCH 3 /* no such process */.

But many quirky systems have no or incomplete header-files installed.

But as Roberto Flor said, this is a problem of the system, no general
compiler or program error. You should verify that errno.h is included in
the source (#include <sys/errno.h>). Everything else is on the users
side.

cu

Andreas

--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
Andreas.Lange@Rhein-Main.de, A.C.Lange@GMX.net

----------------------------------------
If you want to unsubscribe from GRASS Development
Team internal mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'
length: 2516
max: 0

Markus Neteler wrote:

Dear developers,

another own compile problem I have with
r.binfer/Linux.

I have two different platforms running Linux.

A definition in:
src/raster/r.binfer/binfer.l
is causing problems.

[row 39]

#ifndef sparc
#ifndef linux
int yylineno = 1;
#endif
#endif

On machine one above compiles, on machine two I get
binfer.l: In function 'yylex':
binfer.l:114: 'yylineno' undeclared (first use in this function)
binfer.l:114: (Each undeclared identifier is reported only once
binfer.l:114: for each function it appears in.)
make: *** [OBJ.i586-linux-elf/lex.o] Error 1

It is quite strange. Any ideas?

If using:
#ifndef sparc
int yylineno = 1;
#endif

machine 1 likes it, machine 2 says: 'yylineno' undeclared.

I don't know how to declare yylineno properly. I need a better
#ifdef condition sensitive for something else that "linux".

This shall be the final bugfix before GRASS 5 beta7 can be
released :slight_smile:

Best regards

Markus

Hi again,

i have no definitive answer, only some ideas. I had problems on IRIX
compiling programs that use lex/flex and yacc/bison. I can't remember
how i solved this, but i had the impression that the order in which
libraries (-ll or -lfl) are given on the command line to gcc/linker
matters. You also could check if the makefile calls lex or flex -l
(compatibility mode of flex). Do the two linux machines have different
versions of flex installed? Have no time to dig deeper into lexical
analysing with flex.

cu

Andreas

--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
Andreas.Lange@Rhein-Main.de, A.C.Lange@GMX.net

----------------------------------------
If you want to unsubscribe from GRASS Development
Team internal mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'
length: 3133
max: 0

Hi there,

thanks for you comments. The problem is: I need a general
solution valid for all platforms without any further
changes

:-))

So it must be some #ifdef stuff, I feel.

Markus

On Tue, Apr 18, 2000 at 10:02:42AM +0200, Michel Wurtz - ENGEES/CEREG wrote:

Markus Neteler wrote:
>
> Dear developers,
>
> another own compile problem I have with
> r.binfer/Linux.
>
> I have two different platforms running Linux.
>
> A definition in:
> src/raster/r.binfer/binfer.l
> is causing problems.
>
> [row 39]
>
> #ifndef sparc
> #ifndef linux
> int yylineno = 1;
> #endif
> #endif
>
> On machine one above compiles, on machine two I get
> binfer.l: In function 'yylex':
> binfer.l:114: 'yylineno' undeclared (first use in this function)
> binfer.l:114: (Each undeclared identifier is reported only once
> binfer.l:114: for each function it appears in.)
> make: *** [OBJ.i586-linux-elf/lex.o] Error 1
>
> It is quite strange. Any ideas?

Are you using flex ? (the lex program from GNU/FSF)
I had the same message. Look at the command being run
If it is flex instead of lex, you have to add the -l option.
"flex -l" knows about yylineno, but not flex. The man page said:

flex's -l option turns on maximum compatibility with the original
AT&T lex implementation, at the cost of a major loss in the gen-
erated scanner's performance. We note below which incompatibili-
ties can be overcome using the -l option.

flex is fully compatible with lex with the following exceptions:
- The undocumented lex scanner internal variable yylineno is
        not supported unless -l or %option yylineno is used.

etc.

Doing this solved the problem when compiling grass4.3 with a
Slakware 7.0 Linux distribution, and installing flex and not lex.
The normal way is to have a shell script /usr/bin/lex which looks

#!/bin/sh
flex -l $*

but this file wasn't created on my home machine (altough it was
on my work machine : wrong answer while installing Linux ?)
--
Michel Wurtz ENGEES - CEREG
                1, quai Koch - BP 1039, F-67070 STRASBOURG cedex
                Tel: +33 03.88.24.82.45 Fax: +33 03.88.37.04.97

--
Dipl.-Geogr. Markus Neteler * University of Hannover
Institute of Physical Geography and Landscape Ecology
Schneiderberg 50 * D-30167 Hannover * Germany
Tel: ++49-(0)511-762-4494 Fax: -3984

----------------------------------------
If you want to unsubscribe from GRASS Development
Team internal mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'
length: 3461
max: 0

Dear Michel,

it seems that you idea is perfect:
binfer.l

I added
%option lex-compat

at top of file. The yylineno def is now:

#ifndef sparc
#ifndef linux
int yylineno = 1;
#endif
#endif

Then it compiles on both platforms I have. BTW: flex is on
both, but one box is SuSe6.2, the other SuSe6.4 Linux distribution.

Thanks for your hint!

Markus

On Tue, Apr 18, 2000 at 04:17:10PM +0200, Michel Wurtz - ENGEES/CEREG wrote:

Markus Neteler wrote:
>
> Hi there,
>
> thanks for you comments. The problem is: I need a general
> solution valid for all platforms without any further
> changes
>
> :-))
>
> So it must be some #ifdef stuff, I feel.

The problem is : some version of lex define yylineno, others
don't (flex is a "good" example). With Linux, you can install
the genuine flex analyser and/or the AT&T lex compatible...

Therfore I don't believe that #ifdef works, unless you have
some define indication the presence of the -l flag. If yoy suppress
the line #ifndef linux, it will work on your second system, but
compilation will crash on the first one (double definition of yylineno) !
Maybe adding the line

%option yylineno

(or %option lexcompat, which have the same result as the -l option)
may help if it doesn't hurt the classic AT&T lex program ?

--
Michel Wurtz ENGEES - CEREG
                1, quai Koch - BP 1039, F-67070 STRASBOURG cedex
                Tel: +33 03.88.24.82.45 Fax: +33 03.88.37.04.97

--
Dipl.-Geogr. Markus Neteler * University of Hannover
Institute of Physical Geography and Landscape Ecology
Schneiderberg 50 * D-30167 Hannover * Germany
Tel: ++49-(0)511-762-4494 Fax: -3984

----------------------------------------
If you want to unsubscribe from GRASS Development
Team internal mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'
length: 2773
max: 0