Re: Compiler warnings on SunOS



Hi, Roland!

> compiling mc-4.55 on SunOS raises some compiler warnings. You might want to 
> avoid them.

I know about those warnings.  The problem is that most of them either 
happen in the files that come from other projects (gettext, popt), or 
cannot be fixed without introducing extra complexity (e.g. casts).

The only exception is using signed char with the function like isspace().  
It seems that the standard requires unsigned char to be used with such 
functions.  This will be fixed.

> loadmsgcat.c: In function `_nl_load_domain':
> loadmsgcat.c:510: warning: subscript has type `char'

Files from gettext.  The fix is in gettext-0.11.2, but it's not likely to 
be used in the next release of MC.

> direntry.c: In function `vfs_s_dump':
> direntry.c:1015: warning: int format, long int arg (arg 4)

mode_t is unsigned int in glibc.  No easy fix.

> tar.c: In function `from_oct':
> tar.c:43: warning: subscript has type `char'
> tar.c:54: warning: subscript has type `char'
> ftpfs.c: In function `setup_passive':
> ftpfs.c:873: warning: subscript has type `char'
> ftpfs.c:877: warning: subscript has type `char'

Fixed in MC CVS right now.

> util.c: In function `size_trunc_sep':
> util.c:294: warning: subscript has type `char'
> util.c: In function `skip_numbers':
> util.c:829: warning: subscript has type `char'

Fixed.

> screen.c: In function `string_file_perm_octal':
> screen.c:312: warning: unsigned int format, mode_t arg (arg 4)
> screen.c: In function `string_file_nlinks':
> screen.c:322: warning: int format, long int arg (arg 4)
> screen.c: In function `string_file_nuid':
> screen.c:342: warning: int format, uid_t arg (arg 4)
> screen.c: In function `string_file_ngid':
> screen.c:352: warning: int format, gid_t arg (arg 4)

These are int in glibc.

> In file included from key.c:48:
> /usr/openwin/include/X11/Xlib.h:32: warning: ignoring pragma: "@(#)Xlib.h     
>   1.10    00/10/12 SMI

This is not in MC.

> file.c: In function `do_transform_source':
> file.c:210: warning: subscript has type `char'
> find.c: In function `search_content':
> find.c:427: warning: subscript has type `char'
> user.c: In function `expand_format':
> user.c:189: warning: subscript has type `char'
> user.c: In function `execute_menu_command':
> user.c:601: warning: subscript has type `char'
> user.c:603: warning: subscript has type `char'

Fixed.

> subshell.c: In function `init_subshell':
> subshell.c:436: warning: int format, pid_t arg (arg 4)
> subshell.c: In function `exit_subshell':
> subshell.c:780: warning: int format, pid_t arg (arg 4)
> main.c: In function `OS_Setup':
> main.c:2390: warning: int format, pid_t arg (arg 4)

No easy fix.

> main.c: In function `handle_args':
> main.c:2878: warning: subscript has type `char'

Fixed.

> poptparse.c: In function `poptParseArgvString':
> poptparse.c:48: warning: subscript has type `char'

This is from popt, and even the latest popt from rpm-4.0.4 doesn't fix it.

> charsets.c: In function `translate_character':
> charsets.c:116: warning: passing arg 2 of `iconv' from incompatible pointer 
> type

What's the declaration of iconv() on your system?  glibc-2.2.4 expects 
char** at the second argument.

> That's all. It's just because I like programs that compile without any 
> warnings ...

Me too :-)

-- 
Regards,
Pavel Roskin




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