Closed GoogleCodeExporter closed 9 years ago
My proposed fix is below. The will not impact any users preferring gnu89 as C99
is strictly backwards compatible (and, by extension, gnu99 is backward
compatible with gnu89).
Index: compile_anything.py
===================================================================
--- compile_anything.py (revision 380)
+++ compile_anything.py (working copy)
@@ -114,8 +114,8 @@
sources = safeglob('*.c')
for source in sources:
object_file = source.replace(".c", "") + ".o"
- system(['gcc', '-O3', '-funroll-loops', '-c', '-o', object_file, source])
- system(['gcc', '-O2', '-o', 'MyBot'] + safeglob('*.o') + ['-lm'])
+ system(['gcc', '-std=gnu99' '-O3', '-funroll-loops', '-c', '-o',
object_file, source])
+ system(['gcc', '-std=gnu99', '-O2', '-o', 'MyBot'] + safeglob('*.o') +
['-lm'])
check_path('MyBot')
if language == "Go":
nukeglob('*.6')
Original comment by brian%tr...@gtempaccount.com
on 29 Sep 2010 at 12:10
According to
http://gcc.gnu.org/onlinedocs/gcc-4.5.1/gcc/C-Dialect-Options.html, the default
is gnu89, which supports some C99 features, while gnu99 is a dialect of C99.
What features of gnu99 minus c99 are you using?
Original comment by jokeserver
on 2 Oct 2010 at 2:09
It appears that C compilation doesn't work at all, even for ANSI C. Please see
issue 187.
Original comment by jklan...@gmail.com
on 4 Oct 2010 at 8:07
Apparently I can't email my comments. Apologies.
On Sat, Oct 02, 2010 at 02:10:19AM +0000, ai-contest@googlecode.com wrote:
>
> Comment #2 on issue 180 by jokeserver: C99 not supported, only gnu89.
> http://code.google.com/p/ai-contest/issues/detail?id=180
>
> According to
> http://gcc.gnu.org/onlinedocs/gcc-4.5.1/gcc/C-Dialect-Options.html,
> the default is gnu89, which supports some C99 features, while gnu99
> is a dialect of C99.
>
> What features of gnu99 minus c99 are you using?
Yes, gnu99 is a dialect of C99, meaning it is C99 with some added GNU
extensions. gnu89 supports rather very little of C99; as I noted I wish to
make use of the 'restrict' keyword. The features of C99 that gnu89 backports
are mostly to do with pointer aliasing, if memory serves, and no keywords.
C99 (and by extension gnu99) are perfectly backward compatible with gnu89/C90.
Original comment by brian%tr...@gtempaccount.com
on 4 Oct 2010 at 2:06
According to your post, the message you received was: "There was an
unspecificed Error. (compile_function returned None.)"
This is the error covered by Issue 187. In fact, with the absence of any other
error message, I will bet that gcc compiled your entry successfully, but the
bug in Issue 187 prevented your submission from being recognized as successful.
A fix for that issue is in the pipeline. I'd like to see whether that works
before changing compiler flags.
Original comment by jokeserver
on 8 Oct 2010 at 5:31
Fair enough.
Original comment by brian%tr...@gtempaccount.com
on 9 Oct 2010 at 12:50
The fix is now in trunk. Can you resubmit and let me know whether it works?
Original comment by jokeserver
on 12 Oct 2010 at 4:26
Original comment by jokeserver
on 18 Nov 2010 at 7:09
Original issue reported on code.google.com by
brian%tr...@gtempaccount.com
on 29 Sep 2010 at 12:03