fipvlan fails to execute properly on powerpc architecture.
# fipvlan -a Try 'fipvlan --help' for more information # # fipvlan --create --start eth1 Try 'fipvlan --help' for more information # In power pc systems, when there are no more arguments to be parsed, getopt_long should return -1. But gdb output shows that it c is 255 whereas in intel system it shows -1 properly. "char" must not be trusted when signing is important! Different arches (and even different gcc versions on the same arch) may default char to signed or unsigned. Ideally, a portable program should always use signed char or unsigned char when it depends on the signedness of an object. But many programs have been written to use plain char and expect it to be signed, or expect it to be unsigned, depending on the machines they were written for. In this case the variable c is expected to behave as signed and hence using signed would be the safe option. http://gcc.gnu.org/onlinedocs/gcc-4.8.1/gcc/C-Dialect-Options.html Signed-off-by: Raju Chakraborty<[email protected]> --- fipvlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fipvlan.c b/fipvlan.c index 6f8cf39..e51358f 100644 --- a/fipvlan.c +++ b/fipvlan.c @@ -471,7 +471,7 @@ static void help(int status) static void parse_cmdline(int argc, char **argv) { - char c; + signed char c; while (1) { c = getopt_long(argc, argv, GETOPT_STR, long_options, NULL); Thanks, Raju _______________________________________________ fcoe-devel mailing list [email protected] http://lists.open-fcoe.org/mailman/listinfo/fcoe-devel
