Giter Club home page Giter Club logo

Comments (5)

rcls avatar rcls commented on June 28, 2024

Changing the Makefile to "--std=c99" instead of "--std=c11" works for me. Could you send the exact error you get with c99?

from crap.

efalk avatar efalk commented on June 28, 2024

OK, I set --std=c99 and did a build. My results:

$ gcc --version
gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ make
gcc -O2 --std=c99 -Wall -Wextra -Werror -D_GNU_SOURCE -g3 -MMD -MP -MF.deps/branch.o.d -c -o branch.o -c branch.c
cc1: warnings being treated as errors
In file included from branch.c:19:
file.h:64: error: declaration does not declare anything
make: *** [branch.o] Error 1

(Oddly, this is a different error than I got before, without the c99
option.)

When I brought down the master branch from git and tried a build, I got
this:

$ make
gcc -O2 -Wall -Wextra -Werror -D_GNU_SOURCE -g3 -MMD -MP -MF.deps/branch.o.d -c -o branch.o -c branch.c
branch.c: In function 'break_cycle':
branch.c:106: error: conflicting types for 'i'
branch.c:83: error: previous definition of 'i' was here
branch.c:106: error: 'for' loop initial declaration used outside C99 mode
branch.c: In function 'tag_released':
branch.c:123: error: 'for' loop initial declaration used outside C99 mode
branch.c:127: error: conflicting types for 'i'
branch.c:123: error: previous definition of 'i' was here
branch.c:127: error: 'for' loop initial declaration used outside C99 mode
branch.c: In function 'branch_graph':
branch.c:158: error: 'for' loop initial declaration used outside C99 mode
branch.c:160: error: 'for' loop initial declaration used outside C99 mode
branch.c:173: error: redefinition of 'i'
branch.c:158: error: previous definition of 'i' was here
...

This is basically related to declaring a variable inside a for() loop,
which is a new-ish thing in C.

Anyway, my use case is pretty simple, and cvs-fast-export did the trick
for me just fine, and I'm running a pretty old OS on my server (Ubuntu
9), and I'm probably the only person seeing these problems, so if you
want to just close this issue, I'm fine with it.

-Ed Falk

On 4/16/16 6:44 PM, rcls wrote:

Changing the Makefile to "--std=c99" instead of "--std=c11" works for
me. Could you send the exact error you get with c99?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#14 (comment)

from crap.

rcls avatar rcls commented on June 28, 2024

Ok, the error from file.h is due to using an anonymous union. Which appears to be a c11 construct allowed by some versions of gcc in c99 but not your version.

Just removing the "union { ... }" around those two struct members in file.h would probably fix it.

Incidently, the default for your gcc is probably not c99, one that old will be defaulting to c89/c90. I don't intend to support c89/c90, I'm not as masochistic as the kernel folks :-)

from crap.

efalk avatar efalk commented on June 28, 2024

Meh; don't worry about it.

Me, I'm kind of old-school. I was doing some maintenance on the app I
use to sort my email, and realized that about half of the code in it was
K&R C.

-ed falk

On 4/19/16 10:46 AM, rcls wrote:

Ok, the error from file.h is due to using an anonymous union. Which
appears to be a c11 construct allowed by some versions of gcc in c99 but
not your version.

Just removing the "union { ... }" around those two struct members in
file.h would probably fix it.

Incidently, the default for your gcc is probably not c99, one that old
will be defaulting to c89/c90. I don't intend to support c89/c90, I'm
not as masochistic as the kernel folks :-)


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#14 (comment)

from crap.

rcls avatar rcls commented on June 28, 2024

I have updated various comments on exactly what compiler flags to use (-std=gnu99 -fms-extensions should work with gcc back to 3.0 or so).

from crap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.