Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old April 19, 2017, 23:53   #31
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,317
Donated: $40
Pete Mack is on a distinguished road
Don't bother. There are a lot of these lists in .h files; many are included more than once using different transformation macros. There is no clean way to remove the trailing comma in those cases. Disable the warning with a pragma if you really care.

Quote:
Originally Posted by Siemelink View Post
Yes.
When I compiled the snippet separately I could get the warning and also the correct contents from the array.

Willem.
Pete Mack is offline   Reply With Quote
Old April 20, 2017, 00:10   #32
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,317
AnonymousHero is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
Don't bother. There are a lot of these lists in .h files; many are included more than once using different transformation macros. There is no clean way to remove the trailing comma in those cases. Disable the warning with a pragma if you really care.
Yeah, I think this another one of those C99 things that MS never bothered to implement?
AnonymousHero is offline   Reply With Quote
Old April 20, 2017, 00:15   #33
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,317
Donated: $40
Pete Mack is on a distinguished road
No. It's a warning message that is occasionally (rarely) useful, but not in the case of generated code. Like any warning message, you can disable it. It's not C99 at all; it's part of the original K&R spec.
Pete Mack is offline   Reply With Quote
Old April 20, 2017, 00:20   #34
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,317
AnonymousHero is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
No. It's a warning message that is occasionally (rarely) useful, but not in the case of generated code. Like any warning message, you can disable it. It's not C99 at all; it's part of the original K&R spec.
Really? I stand corrected, I guess. I just remember something vaguely similar in C99-vs-C89 discussions.
AnonymousHero is offline   Reply With Quote
Old April 20, 2017, 02:16   #35
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,317
Donated: $40
Pete Mack is on a distinguished road
It turns out to be surprisingly hard to get an answer on this. There are claims both ways, including that it was left out of C89 by accident, and added to C90. It was certainly part of K&R. Here's the most definitive answer I found.
https://bytes.com/topic/c/answers/21...alizer-allowed
Scroll down to Dan Pop's answer, Nov 14, 2005
Quote:
It turns out I was wrong: it was a standard C feature since "day one",
i.e. since K&R1 was printed. Retained by the standardisation committee
because "it provides flexibility in adding or deleting members from
an initializer list, and simplifies machine generation of such lists".
Pete Mack is offline   Reply With Quote
Old May 6, 2017, 17:39   #36
t4nk
Adept
 
Join Date: May 2016
Posts: 249
t4nk is on a distinguished road
Quote:
Originally Posted by AnonymousHero View Post
@t4nk: I actually thought seriously about using D "back in the day", but honestly
Hey, AnonymousHero. After a reasonably thorough investigation, I came to the conclusion that you're right.
Still, it is our moral duty and obligation as programmers to avoid inflicting any more C++ on the world
Rust is the next on my list of newflangled languages to investigate
All I want is a better C... specifically, C with better memory management, better strings and better arrays (including associative arrays), but with full C interop. Better C++ would also be acceptable... Rust is most likely isn't it, but we'll see.

P.S: I must say, though, that the D language itself is great, just the implementation is lacking. I will revisit it in a year or so, hopefully there will be some improvements...

Last edited by t4nk; May 6, 2017 at 20:53.
t4nk is offline   Reply With Quote
Old May 6, 2017, 22:38   #37
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,317
Donated: $40
Pete Mack is on a distinguished road
Well, there are Java and C#. Both have better strings than C.
Pete Mack is offline   Reply With Quote
Old May 6, 2017, 22:56   #38
t4nk
Adept
 
Join Date: May 2016
Posts: 249
t4nk is on a distinguished road
But how do I run them without their gigantic runtimes Those might be better, but they're not C, so they don't qualify as "better C".
Also, performance is not good enough (pls no microbenchmarks...)
t4nk is offline   Reply With Quote
Old May 7, 2017, 02:33   #39
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,317
Donated: $40
Pete Mack is on a distinguished road
Yeah, the runtime libraries are pretty ridiculous, I agree. But the performance is probably good enough for roguelikes.
Pete Mack is offline   Reply With Quote
Old May 7, 2017, 02:43   #40
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,020
Derakon is on a distinguished road
If you can make a playable roguelike in Python or GameMaker, you can do it in Java or C#. The performance complaint about Java was kind of valid when it first came out, but they've had two decades to optimize the runtime now. It's plenty fast.
Derakon is online now   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling Z+Angband Ravenheart87 Variants 7 May 24, 2011 09:35
Compiling 3.2 Omnipact Development 6 December 27, 2010 10:39
compiling in VC6 NeoWizard Vanilla 1 January 16, 2009 03:10
Compiling in Linux trickypig Vanilla 6 November 16, 2008 16:26
Compiling 3.0.9b under SuSE 9.3 ... TJA Vanilla 14 May 12, 2008 22:17


All times are GMT +1. The time now is 02:44.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.