www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/04/15/08:35:45

Message-ID: <B0000083478@stargate.astr.lu.lv>
From: "Andris Pavenis" <pavenis AT lanet DOT lv>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, djgpp-workers AT delorie DOT com
Date: Thu, 15 Apr 1999 15:34:36 +0300
MIME-Version: 1.0
Subject: Re: Some small patches to current CVS version of DJGPP
References: <B0000083439 AT stargate DOT astr DOT lu DOT lv>
In-reply-to: <Pine.SUN.3.91.990415141117.26213q-100000@is>
X-mailer: Pegasus Mail for Win32 (v3.02b14)
Reply-To: djgpp-workers AT delorie DOT com

On 15 Apr 99, at 14:14, Eli Zaretskii wrote:

> 
> On Thu, 15 Apr 1999, Andris Pavenis wrote:
> 
> > Here are 3 small patches to current CVS version of DJGPP I had to apply to
> > get it compiled with egcs 2.93.18 19990412
> 
> Thanks.
> 
> > setjmp.h:
> > 	I added name to anonymous struct similary as it is done in glibc-2.1 (I didn't
> >       even copy the name there) as I got compile time error where jmp_buf were
> >       used as parameter for external procedure.
> 
> How come?  I don't suppose EGCS doesn't support anonymous structs, does 
> it?  Can you please post a small test case and the exact error message?

It's src/libemu/src/emu387.cc. With latest egcs snapshot I'm getting 
(I run make in that directory)

gcc ... -c emu387.cc
cc1plus.exe: warnings being treated as errors
emu387.cc:3494: warning: non-local function `int _emu_entry({anonymous 
struct} *)' uses anonymous type
make.exe: *** [emu387.o] Error 1

There seems to be no such problems with egcs-1.1.2 (I don't have older versions
installed)

/usr/include/setjmp.h from glibc-2.1 also defines name of this structure
(no anonymous struct) and there is additional comment that C++ does not
like  tagless structs (fragment from setjmp.h from glibc-2.1)

/* Calling environment, plus possibly a saved signal mask.  */
typedef struct __jmp_buf_tag	/* C++ doesn't like tagless structs.  */
  {
    /* NOTE: The machine-dependent definitions of `__sigsetjmp'
       assume that a `jmp_buf' begins with a `__jmp_buf'.
       Do not move this member or add others before it.  */
    __jmp_buf __jmpbuf;		/* Calling environment.  */
    int __mask_was_saved;	/* Saved the signal mask?  */
    __sigset_t __saved_mask;	/* Saved signal mask.  */
  } jmp_buf[1];

I tested building djgpp libraries under DOSEMU-0.99.9 running under 
Linux so there were no problem to browse /usr/include/setjmp.h.

Maybe only we should use:  typedef struct __dj_jmp_buf { ...

> 
> > ! static void
> >   tzsetwall(void)
> 
> No, this is wrong.  `tzsetwall' is an external function that is supposed 
> to be used by applications (it is just undocumented, but that's easily 
> corrected ;-).  So declaring it static is not the solution.
> 

Maybe. Then there is another bug in line 162 where the same function is declared 
as static. Here is patch:

*** CTIME.C~1	Mon Mar 22 10:33:58 1999
--- CTIME.C	Thu Apr 15 15:03:02 1999
***************
*** 159,165 ****
  static int		tzload P((const char * name, struct state * sp));
  static int		tzparse P((const char * name, struct state * sp,
  				int lastditch));
! static void		tzsetwall(void);
  
  #ifdef ALL_STATE
  static struct state *lclptr;
--- 159,165 ----
  static int		tzload P((const char * name, struct state * sp));
  static int		tzparse P((const char * name, struct state * sp,
  				int lastditch));
! void		tzsetwall(void);
  
  #ifdef ALL_STATE
  static struct state *lclptr;



Andris

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019