Dude, did you seriously just write and compile a C program from within
a ruby script?

On 1 November 2012 05:11, Carlo E. Prelz <fluido / fluido.as> wrote:
>         Subject: Re: bug?: local variable created in if modifier not avai=
lable in modified expression
>         Date: Thu 01 Nov 12 03:57:47AM +0900
>
> Quoting Robert Klemme (shortcutter / googlemail.com):
>
>> You mean like
>>
>> $ ruby -ce 'if a =3D 9 then puts 1 end'
>> -e:1: warning: found =3D in conditional, should be =3D=3D
>> Syntax OK
>>
>> ?
>
> Yes, that's why I really like Ruby. But GCC can also be helpful in this:
>
> #!/usr/bin/env ruby
> File::open('/tmp/test.c','w') do |f|
>   f.write <<-EOF
> #include <stdio.h>
> int main(int argc,char *argv[])
> {
>   int i=3D1;
>   if(i=3D3)
>     printf("Bla bla\\n");
>
>   return 0;
> }
> EOF
> end
> system('gcc -o /tmp/test -Wall /tmp/test.c')
>
> gcc prints this warning:
>
> /tmp/test.c: In function =91main=92:
> /tmp/test.c:5:3: warning: suggest parentheses around assignment used as t=
ruth value [-Wparentheses]
>
> Carlo
>
> --
>   *         Se la Strada e la sua Virtu' non fossero state messe da parte=
,
> * K * Carlo E. Prelz - fluido / fluido.as             che bisogno ci sarebb=
e
>   *               di parlare tanto di amore e di rettitudine? (Chuang-Tzu=
)
>



--=20
  Matthew Kerwin, B.Sc (CompSci) (Hons)
  http://matthew.kerwin.net.au/
  ABN: 59-013-727-651

  "You'll never find a programming language that frees
  you from the burden of clarifying your ideas." - xkcd