lua-users home
lua-l archive

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


On Thu 8 Sep 2011, at 12:24, Reuben Thomas wrote:

> I got a contradictory result:
> 
> $ cat foo.c
> #include <stdio.h>
> 
> int main (void)
> {
>  FILE *f = fopen("foo", "r");
>  int ret = fprintf(f, "dfoo");
>  printf ("%d %d\n", ret, ferror(f));
> }
> $ gcc -o foo foo.c
> $ ./foo
> -1 1

Weird. It prints 4 1 for me.

Darwin bips2002.fibl.ch 11.1.0 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64 x86_64
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
Copyright (C) 2007 Free Software Foundation, Inc.

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/