≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Bug #1627

Bug #1627: error: 'for' loop initial declarations are only allowed in C99 mode

Kind bug
Product Command-T
When Created 2010-07-29T21:24:17Z, updated 2010-07-31T04:36:44Z
Status closed
Reporter anonymous
Tags no tags

Description

running make after ruby extconf.rb produces this.

gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_H    -fPIC -fno-strict-aliasing -g -g -O2  -fPIC   -c matcher.c
matcher.c: In function ‘CommandTMatcher_sorted_matchers_for’:
matcher.c:122: error: ‘for’ loop initial declarations are only allowed in C99 mode
matcher.c:122: note: use option -std=c99 or -std=gnu99 to compile your code
matcher.c: In function ‘CommandTMatcher_matches_for’:
matcher.c:155: error: ‘for’ loop initial declarations are only allowed in C99 mode
make: *** [matcher.o] Error 1

Comments

  1. Greg Hurrell 2010-07-30T01:36:01Z

    So it's supposed to be passing in -std=c99 but some reason isn't.

    Can you have a look in your ~/.vim/ruby/command-t directory and confirm that the depend file is actually there, and that it contains this line:

    CFLAGS += -std=c99 -Wall -Wextra -Wno-unused-parameter

    Can you also paste in the generated Makefile? The -std=c99 flag should appear in it.

  2. dlazar 2010-07-30T12:29:59Z

    Hi,

    There is no depend file in the command-t directory. The file list is:

    controller.rb
    ext.c
    extconf.rb
    ext.h
    ext.o
    ext.so
    files.txt
    finder.rb
    Makefile
    match.c
    matcher.c
    matcher.h
    matcher.o
    match.h
    match.o
    match_window.rb
    prompt.rb
    ruby_compat.h
    scanner.rb
    settings.rb
    stub.rb

    And the Makefile is: http://gist.github.com/500829

    I tried adding the flag in myself and tried make. It returns a piddly subset of what I think should be the results of the Makefile.

    gcc   -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_H    -fPIC -fno-strict-aliasing -g -g -O2  -fPIC  -std=c99 -c matcher.c
    gcc   -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_H    -fPIC -fno-strict-aliasing -g -g -O2  -fPIC  -std=c99 -c match.c
    gcc   -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_H    -fPIC -fno-strict-aliasing -g -g -O2  -fPIC  -std=c99 -c ext.c
    gcc   -shared -o ext.so matcher.o match.o ext.o -L. -L/usr/lib -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic    -lruby1.8  -lpthread -lrt -ldl -lcrypt -lm   -lc

    That was all that was reported. I think when I did this step on OSX, it made a lot more code. Maybe I am mistaken.. but anyway, the result is, still no working command-t.

    Thanks for listening!!

  3. Greg Hurrell 2010-07-30T12:40:31Z

    Sounds to me like the vimball didn't extract properly, as the depend file is definitely supposed to be there. Can you try and extract it again? ie. open the vimball again:

    $ vim command-t-0.8b.vba

    And from inside Vim do:

    :so %

    Once it is extracted you should have at least all of these files in your ~/.vim/ruby/command-t/ directory, and possible some other files too (things like *.o and Makefile and mkmf.log files from your first attempt):

    controller.rb
    depend
    ext.c
    ext.h
    extconf.rb
    finder.rb
    match.c
    match.h
    match_window.rb
    matcher.c
    matcher.h
    prompt.rb
    ruby_compat.h
    scanner.rb
    settings.rb
    stub.rb
    vim/screen.rb
    vim/window.rb
    vim.rb

    And you can proceed to do ruby extconf.rb && make.

    If the build seems to be correct but it doesn't work in Vim, let me know what error message is shown and we can try to sort it out.

  4. Greg Hurrell 2010-07-30T12:40:57Z

    Summary changed:

    • From: compiler error
    • To: error: 'for' loop initial declarations are only allowed in C99 mode
  5. dlazar 2010-07-30T21:08:47Z

    That was it. vimball extraction #2 had all the goods. Everything worked fine second time around. Closed issue. Thanks

  6. Greg Hurrell 2010-07-31T04:36:44Z

    Status changed:

    • From: new
    • To: closed
Add a comment

Comments are now closed for this issue.

  • contact
  • legal

Menu

  • Blog
  • Wiki
  • Issues
  • Snippets