Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Daniel Gruner <dgruner@tikva.chem.utoronto.ca>
Subject: Re: g++ warnings and problems
Date: Fri, 24 Jan 1997 18:21:54 -0500 (EST)	[thread overview]
Message-ID: <199701242321.SAA04475@ tikva> (raw)

Well, I kept on looking, and it turns out there is indeed a problem with
the libg++ that gets installed by default in RedHat 4.0.

I installed the source rpm for libg++  (libg++-2.7.1.4-4.src.rpm),
applied the two patch files (libg++-2.7.1-2.7.1.4.diff and
libg++-2.7.1rh-glibc.diff, in that order), and lo-and-behold, the file
libio.h is different than /usr/include/libio.h, and by exactly the
missing declarations.  Here is a context diff (diff -c) between the files
libio.h.orig and libio.h:
=====================================================================

*** libio.h.orig        Fri Jan 24 18:02:25 1997
--- libio.h     Fri Jan 24 18:02:42 1997
***************
*** 262,267 ****
--- 262,283 ----
  #define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0)
  #define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0)
  
+ #ifndef _IO_getc
+ # define _IO_getc(f)  _IO_getc_unlocked(f)
+ #endif
+ #ifndef _IO_peekc
+ # define _IO_peekc(f) _IO_peekc_unlocked(f)
+ #endif
+ #ifndef _IO_putc
+ # define _IO_putc(c,f)        _IO_putc_unlocked(c,f)
+ #endif
+ #ifndef _IO_feof
+ # define _IO_feof(f)  _IO_feof_unlocked(f)
+ #endif
+ #ifndef _IO_ferror
+ # define _IO_ferror(f)        _IO_ferror_unlocked(f)
+ #endif
+ 
  /* This one is for Emacs. */
  #define _IO_PENDING_OUTPUT_COUNT(_fp) \
        ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base)
***************
*** 282,287 ****
--- 298,306 ----
  extern int _IO_vfprintf __P((_IO_FILE*, const char*, _IO_va_list));
  extern _IO_ssize_t _IO_padn __P((_IO_FILE *, int, _IO_ssize_t));
  extern _IO_size_t _IO_sgetn __P((_IO_FILE *, void*, _IO_size_t));
+ 
+ extern _IO_fpos_t _IO_seekoff __P((_IO_FILE*, _IO_off_t, int, int));
+ extern _IO_fpos_t _IO_seekpos __P((_IO_FILE*, _IO_fpos_t, int));
  
  extern void _IO_free_backup_area __P((_IO_FILE*));
  
=====================================================================
Now I don't get these annoying warnings or the errors about unresolved 
externals.  Whether this will break any code or parts of linux, I don't
know (doesn't sound likely).  I am surprised this was not caught by
the good folks at RedHat, who presumably used g++ quite a lot in building
the 4.0 distribution.

Whether ddd will now work or not is now anybody's guess, since it uses
lesstif, which is a story in its own right.

Daniel

> 
> Hi
> 
> I have been troubled by messages like:
> 
> In file included from /usr/include/g++/iostream.h:31,
>                  from TypeInfo.h:36,
>                  from Delay.h:39,
>                  from SourceView.C:71:
> /usr/include/g++/streambuf.h:351: warning: implicit declaration of function `int _IO_seekoff(...)'
> /usr/include/g++/streambuf.h: In method `long int streambuf::pubseekpos(long int, int = 3)':
> /usr/include/g++/streambuf.h:353: warning: implicit declaration of function `int _IO_seekpos(...)'
> /usr/include/g++/streambuf.h: In method `int streambuf::sputc(int)':
> /usr/include/g++/streambuf.h:384: warning: implicit declaration of function `int _IO_putc(...)'
> /usr/include/g++/streambuf.h: In method `int streambuf::sbumpc()':
> /usr/include/g++/streambuf.h:385: warning: implicit declaration of function `int _IO_getc(...)'
> /usr/include/g++/streambuf.h: In method `int streambuf::sgetc()':
> /usr/include/g++/streambuf.h:386: warning: implicit declaration of function `int _IO_peekc(...)'
> 
> 
> although my programs seem to work fine.  However, today I have been trying
> to compile "ddd", and I get the following from the linker:
> 
> strclass.o: In function `operator>>(istream &, string &)':
> /usr/include/g++/streambuf.h:385: undefined reference to `_IO_getc'
> /usr/include/g++/streambuf.h:385: undefined reference to `_IO_getc'
> strclass.o: In function `readline(istream &, string &, char, int)':
> /usr/include/g++/streambuf.h:385: undefined reference to `_IO_getc'
> /usr/include/g++/streambuf.h:385: undefined reference to `_IO_getc'
> show.o: In function `show_resources(_XrmHashBucketRec *)':
> /usr/include/g++/streambuf.h:385: undefined reference to `_IO_getc'
> show.o:/usr/include/g++/streambuf.h:385: more undefined references to `_IO_getc' follow
> show.o: In function `show_resources(_XrmHashBucketRec *)':
> /usr/include/g++/streambuf.h:384: undefined reference to `_IO_putc'
> /usr/include/g++/streambuf.h:384: undefined reference to `_IO_putc'
> make[1]: *** [ddd-2.0-alpha-unknown-linux] Error 1
> 
> 
> I have been searching for definitions of the "missing functions" (first
> set of warning messages above) to no avail.  Are they missing due to
> an oversight?  Also, and more to the point, I don't see any references
> to functions called "_IO_putc" or "_IO_getc" in the system libraries
> either...
> 
> I am running RedHat 4.0, kernel 2.0.27.  Does anybody know what the problem
> is, and if so whether there are patches for this?
> 
> Thanks,
> Daniel
> -- 
> 
> Dr. Daniel Gruner                        dgruner@tikva.chem.utoronto.ca
> Dept. of Chemistry                       phone:  (416)-978-8689
> University of Toronto                    fax:    (416)-978-5325
> 
> --
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com
> 

-- 

Dr. Daniel Gruner                        dgruner@tikva.chem.utoronto.ca
Dept. of Chemistry                       phone:  (416)-978-8689
University of Toronto                    fax:    (416)-978-5325

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

             reply	other threads:[~1997-01-24 23:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-24 23:21 Daniel Gruner [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-01-24 17:42 g++ warnings and problems Art Werschulz
1997-01-24 17:25 Daniel Gruner
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox