>Description:
mysqld.cc will not compile with Sun Workshop 6
        CC: Sun WorkShop 6 2000/08/30 C++ 5.1 Patch 109490-01
Failing with the following errors:
------------------------------------------------------------------------------
make[3]: Entering directory `/home/unit/cu/dcv/src/local/mysql-3.23.40/sql'
CC -DMYSQL_SERVER                       -DDEFAULT_MYSQL_HOME="\"/usr/local/mysql\""    
                 -DDATADIR="\"/usr
/local/mysql/var\""                     -DSHAREDIR="\"/usr/local/mysql/share/mysql\""  
                 -DHAVE_CONFIG_H -
I./../include                   -I./../regex                    -I. -I../include -I.. 
-I.  -I/usr/local/include  -O3 -DDB
UG_OFF -O  -DHAVE_CURSES_H -I/home/unit/cu/dcv/src/local/mysql-3.23.40/include 
-DHAVE_RWLOCK_T -c mysqld.cc
"item_cmpfunc.h", line 286: Warning (Anachronism): Formal argument 4 of type extern 
"C" int(*)(const void*,const void*) i
n call to std::qsort(void*, unsigned, unsigned, extern "C" int(*)(const void*,const 
void*)) is being passed int(*)(const 
void*,const void*).
"log_event.h", line 290: Warning: thd hides Load_log_event::thd.
"mysqld.cc", line 637: Warning (Anachronism): Formal argument 2 of type extern "C" 
void(*)(int) in call to sigset(int, ex
tern "C" void(*)(int)) is being passed void(*)(int).
"mysqld.cc", line 1215: Warning (Anachronism): Formal argument 2 of type extern "C" 
void(*)(int) in call to sigset(int, e
xtern "C" void(*)(int)) is being passed void(*)(int).
"mysqld.cc", line 1216: Warning (Anachronism): Formal argument 2 of type extern "C" 
void(*)(int) in call to sigset(int, e
xtern "C" void(*)(int)) is being passed void(*)(int).
"mysqld.cc", line 1224: Warning (Anachronism): Assigning void(*)(int) to extern "C" 
void(*)(int).
"mysqld.cc", line 1272: Warning (Anachronism): Formal argument 3 of type extern "C" 
void*(*)(void*) in call to pthread_cr
eate(unsigned*, const _pthread_attr*, extern "C" void*(*)(void*), void*) is being 
passed void*(*)(void*).
"mysqld.cc", line 1361: Warning (Anachronism): Formal argument 3 of type extern "C" 
void*(*)(void*) in call to pthread_cr
eate(unsigned*, const _pthread_attr*, extern "C" void*(*)(void*), void*) is being 
passed void*(*)(void*).
"mysqld.cc", line 1484: Error: Cannot use const char* to initialize char*.
"mysqld.cc", line 1784: Warning (Anachronism): Assigning int(*)(unsigned,const 
char*,int) to extern "C" int(*)(unsigned,c
onst char*,int).
"mysqld.cc", line 1846: Warning (Anachronism): Formal argument 3 of type extern "C" 
void*(*)(void*) in call to pthread_cr
eate(unsigned*, const _pthread_attr*, extern "C" void*(*)(void*), void*) is being 
passed void*(*)(void*).
"mysqld.cc", line 1855: Warning (Anachronism): Formal argument 3 of type extern "C" 
void*(*)(void*) in call to pthread_cr
eate(unsigned*, const _pthread_attr*, extern "C" void*(*)(void*), void*) is being 
passed void*(*)(void*).
"mysqld.cc", line 2028: Warning (Anachronism): Formal argument 3 of type extern "C" 
void*(*)(void*) in call to pthread_cr
eate(unsigned*, const _pthread_attr*, extern "C" void*(*)(void*), void*) is being 
passed void*(*)(void*).
"mysqld.cc", line 2122: Warning (Anachronism): Formal argument 3 of type extern "C" 
void*(*)(void*) in call to pthread_cr
eate(unsigned*, const _pthread_attr*, extern "C" void*(*)(void*), void*) is being 
passed void*(*)(void*).
1 Error(s) and 13 Warning(s) detected.
make[3]: *** [mysqld.o] Error 1
------------------------------------------------------------------------------
Note the Error, line 1484.  The code round here is
------------------------------------------------------------------------------
static void open_log(MYSQL_LOG *log, const char *hostname,
                     const char *opt_name, const char *extension,
                     enum_log_type type)
{
  char tmp[FN_REFLEN];
...
  // get rid of extention if the log is binary to avoid problems
  if (type == LOG_BIN)
  {
>>>>char* p = strrchr(opt_name, FN_EXTCHAR);
    if (p)
      *p = 0;
  }
  log->open(opt_name,type);
}
------------------------------------------------------------------------------
It's trying to modify the buffer pointed to by opt_name, which is
declared as `const'.

>How-To-Repeat:
Try to compile it!

>Fix:
Me, I'd take a copy of opt_name into a local buffer first.  In fact you seem
to have one to hand, though you could fall foul of limited buffer size.
A workaround is to remove the `const' from opt_name, but that seems
messy (it's typically poking at command line arguments).

>Submitter-Id:  <submitter ID>
>Originator:    
>Organization:
E-Mail: [EMAIL PROTECTED]               PHONE:  +44 24 7652 3037
Rob McMahon, IT Services, Warwick University, Coventry, CV4 7AL, England
>
>MySQL support: none
>Synopsis:      Modification of "const" string in mysqld.cc
>Severity:      non-critical
>Priority:      medium
>Category:      mysql
>Class:         sw-bug
>Release:       mysql-3.23.40 (Source distribution)

>Environment:
        
System: SunOS crocus 5.7 Generic_106541-14 sun4u sparc SUNW,Ultra-Enterprise
Architecture: sun4

Some paths:  /usr/local/bin/perl /usr/local/gnu/bin/make
        /usr/local/bin/gmake /usr/local/gnu/bin/gcc /usr/lang/bin/cc
GCC: Reading specs from /usr/local/gnu/lib/gcc-lib/sparc-sun-solaris2.7/2.95.3/specs
gcc version 2.95.3 20010315 (release)
Compilation info: CC='cc' CFLAGS='-O' CXX='CC' CXXFLAGS='-O' \
CPPFLAGS=-I/usr/local/include LDFLAGS='-L/usr/local/lib -R/usr/local/lib'
CC: Sun WorkShop 6 2000/08/30 C++ 5.1 Patch 109490-01
cc: Sun WorkShop 6 2000/04/07 C 5.1

LIBC: 
-rw-r--r--    1 bin      bin       1732880 Dec 14  2000 /lib/libc.a
lrwxrwxrwx    1 root     root           11 Dec  9  1999 /lib/libc.so -> ./libc.so.1
-rwxr-xr-x    1 bin      bin       1147500 Dec 14  2000 /lib/libc.so.1
-rw-r--r--    1 bin      bin       1732880 Dec 14  2000 /usr/lib/libc.a
lrwxrwxrwx    1 root     root           11 Dec  9  1999 /usr/lib/libc.so -> ./libc.so.1
-rwxr-xr-x    1 bin      bin       1147500 Dec 14  2000 /usr/lib/libc.so.1
Configure command: ./configure  --prefix=/usr/local/mysql --with-libwrap 
--enable-thread-safe-client --without-berkeley-db --without-readline
Perl: This is perl, version 5.005_03 built for sun4-solaris

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to