From: nobu.nokada@... Date: 2004-09-14T01:07:58+09:00 Subject: Re: [PATCH] dir.c --- Dir.chdir error handling Hi, At Mon, 13 Sep 2004 16:54:06 +0900, H.Yamamoto wrote in [ruby-core:03384]: > Probably former because there is difference in type of arguments > between prototype and implementation. > (Maybe this is allowed in C, but I could not find document to confirm. > At least C++ fails.) The latter. VALUEs are not pointers, so difference in qualifiers is OK, even in C++. Actually, it is disallowed only when the dereferenced qualifiers conflict. $ cat a.cc int foo(int); int foo(volatile int x) { x; return x; } $ g++ -c -Wall a.cc $ objdump -d a.o a.o: file format elf32-i386 Disassembly of section .text: 00000000 <_Z3fooi>: 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 8b 45 08 mov 0x8(%ebp),%eax 6: 8b 45 08 mov 0x8(%ebp),%eax 9: c9 leave a: c3 ret $ cat b.c int foo(int *p); int foo(volatile int *p) { return *p; } $ gcc -c b.c b.c:3: conflicting types for `foo' b.c:1: previous declaration of `foo' -- Nobu Nakada