Subject: B17: Compiler-Error
From: [email-masked]

10 Dec 1996 01:11:07 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 8bit
X-Envelope: <[email-masked]>
Original-To: [email-masked]
Phone: (0 / +49) 6841 - 16 3046
Fax: (0 / +49) 6841 - 16 3369
X-Mailer: ELM [version 2.4 PL25]
Original-Sender: [email-masked]

Sirs,

I tried to compile the GNU groff with b17. In the configure script
I replaced /dev/null with /tmp/trash, so this error did not occure.
But there is an error in compilation which did not occure under b16.
The following subroutine which starts at line 424 gave an error:

const char *index_search_item::munge_filename(const char *filename)
{
  if (filename[0] == '/')
    return filename;
  const char *cwd = pool;
  int need_slash = (cwd[0] != 0 && strchr(cwd, '\0')[-1] != '/');  <-----
  int len = strlen(cwd) + strlen(filename) + need_slash + 1;
  if (len > filename_buflen) {
    a_delete filename_buffer;
    filename_buflen = len;
    filename_buffer = new char[len];
  }
  strcpy(filename_buffer, cwd);
  if (need_slash)
    strcat(filename_buffer, "/");
  strcat(filename_buffer, filename);
  return filename_buffer;
}

Here the error-list:
g++ -I. -I. -I../include -I./../include -DHAVE_UNISTD_H=1 -DHAVE_DIRENT_H=1 -DHA
VE_LIMITS_H=1 -DHAVE_SYS_DIR_H=1 -DHAVE_STDLIB_H=1 -DSTDLIB_H_DECLARES_PUTENV=1
-DSTDIO_H_DECLARES_POPEN=1 -DSTDIO_H_DECLARES_PCLOSE=1 -DHAVE_CC_OSFCN_H=1 -DHAV
E_CC_LIMITS_H=1 -DRETSIGTYPE=void -DHAVE_STRUCT_EXCEPTION=1 -DHAVE_RENAME=1 -DHA
VE_MKSTEMP=1 -DWCOREFLAG=0200  -g -O  -c index.cc
index.cc: In method `int index_search_item::load(int)':
index.cc:213: warning: implicit declaration of function `int strchr(...)'
index.cc:213: warning: assignment to `const char *' from `int' lacks a cast
index.cc: In function `class search_item * make_index_search_item(const char *,
int)':
index.cc:276: warning: implicit declaration of function `int strcat(...)'
index.cc: In method `const char * index_search_item::munge_filename(const char *
)':
index.cc:429: invalid types `int[int]' for array subscript
index.cc: In method `void index_search_item::read_common_words_file()':
index.cc:548: no matching function for call to `index_search_item::munge_filenam
e (int)'
index.cc:425: candidates are: index_search_item::munge_filename(const char *)
index.cc: In method `void index_search_item::check_files()':
index.cc:608: warning: initialization to `const char *' from `int' lacks a cast
index.cc:610: warning: assignment to `const char *' from `int' lacks a cast
MAKE.EXE: *** [index.o] Error 1
MAKE.EXE: *** [libbib] Error 2
MAKE.EXE: *** [all] Error 2

There seems to be something wrong in the Compiler. Any ideas?

Dieter

-- 
 Dr. med. dipl.-math Dieter Becker           Tel.: (0 / +49) 6841 - 16 3046
 Medizinische Universitaets- und Poliklinik  Fax.: (0 / +49) 6841 - 16 3332
 Innere Medizin III                         
 D - 66421 Homburg / Saar                    Email: [email-masked]
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".