bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fallback vsnprintf prototype incorrect, mbstr.h also needed (OSF/TRU64)


From: Jay K
Subject: fallback vsnprintf prototype incorrect, mbstr.h also needed (OSF/TRU64)
Date: Sat, 5 Jun 2010 12:10:34 +0000

% uname
OSF1
% uname -r
V5.1
% sh ./support/config.guess
alphaev67-dec-osf5.1
% cc -V
Compaq C V6.3-025 on Compaq Tru64 UNIX V5.1 (Rev. 732)
Compiler Driver V6.3-026 (sys) cc Driver


cc -c  -DHAVE_CONFIG_H -DSHELL   -I. -I..  -I.. -I../include -I../lib -I. 
-I../lib/intl -I/home/jayk/src/bash-4.1/lib/intl   -g printf.c || ( rm -f 
printf.c ; exit 1 )
cc: Warning: ./printf.def, line 175: In this declaration, parameter 4 has a 
different type than specified in an earlier declaration of this function. 
(mismatparam)
extern int vsnprintf __P((char *, size_t, const char *, ...)) 
__attribute__((__format__ (printf, 3, 4)));
-----------^
cc: Error: ./printf.def, line 175: In this declaration, the type of "vsnprintf" 
is not compatible with the type of a previous declaration of "vsnprintf" at 
line number 212 in file /usr/include/stdio.h. (notcompat)
extern int vsnprintf __P((char *, size_t, const char *, ...)) 
__attribute__((__format__ (printf, 3, 4)));
-----------^

fix:

% diff builtins/printf.def.orig builtins/printf.def
175c175
< extern int vsnprintf __P((char *, size_t, const char *, ...)) 
__attribute__((__format__ (printf, 3, 4)));
---
> extern int vsnprintf __P((char *, size_t, const char *, va_list)) 
> __attribute__((__format__ (printf, 3, 4)));


Why didn't the #if HAVE_VSNPRINTF work?
autoconf fell down.

configure:28784: checking for standard-conformant vsnprintf
configure:28846: cc -o conftest -g   conftest.c     >&5
cc: Warning: conftest.c, line 299: The redefinition of the macro "HAVE_SNPRINTF"
 conflicts with a current definition because the replacement lists differ.  The
redefinition is now in effect. (macroredef)
#define HAVE_SNPRINTF 0
----------------------^
configure:28850: $? = 0
configure:28856: ./conftest
./configure[28858]: 76582 Memory fault(coredump)
configure:28860: $? = 139
configure: program exited with status 139
configure: failed program was:


There were also these scary warnings:

cc: Warning: arrayfunc.c, line 732: In this statement, "mbschr(...)" of type 
"int", is being converted to "pointer to char". (cvtdiftypes)
  t = mbschr (name, '[');    /* ] */
--^
cc: Warning: arrayfunc.c, line 792: In this statement, "mbschr(...)" of type 
"int", is being converted to "pointer to char". (cvtdiftypes)
  t = mbschr (s, '[');
--^


c: Warning: bashline.c, line 2698: In this statement, "mbschr(...)" of type 
"int", is being converted to "pointer to char". (cvtdiftypes)
      t = mbschr (local_dirname, '`');



It looks like configure does a link test, but the header is never included.


Maybe better to autoconf these, #if HAVE_MBSTR_H?, maybe older osf doesn't have 
it?


% diff subst.c.orig subst.c
39a40,43
> #ifdef __osf__
> #include <mbstr.h>
> #endif
> 
% diff arrayfunc.c.orig arrayfunc.c
21a22,24
> #ifdef __osf__
> #include <mbstr.h>
> #endif
%


also:


cc: Warning: /Users/chet/src/bash/src/parse.y, line 5486: In this statement, 
the referenced type of the pointer value "EOF_Reached?((const char ...)("syntax 
error: unexpected end of file")):((const char ...)("syntax error"))" is const, 
but the referenced type of the target of this assignment is not. (notconstqual)
      msg = EOF_Reached ? _("syntax error: unexpected end of file") : _("syntax 
error");

cc: Warning: mailcheck.c, line 433: In this statement, the referenced type of 
the pointer value "mailfiles[i]->msg?mailfiles[i]->msg:((const char ...)("You 
have mail in $_"))" is const, but the referenced type of the target of this 
assignment is not. (notconstqual)
      message = mailfiles[i]->msg ? mailfiles[i]->msg : _("You have mail in 
$_");


Just adding const to these doesn't work. I could fix but I didn't.


 - Jay

                                          


reply via email to

[Prev in Thread] Current Thread [Next in Thread]