« first day (909 days earlier)      last day (4037 days later) » 

2:00 AM
@jthill: Right, and unless that member was the last member of the union to which you assigned a value, you shall not retrieve its value. It's as simple as that. — Lightness Races in Orbit 10 hours ago
Key point made here. Allowed in C99 (6.5/7), barely a footnote. In C++, considered UB. And he thinks it is okay and talks about something totally different. Nobody forbids him from casting his crap to a char array, but you don't do type-punning through unions. Unions are not for cowboy casts and wild coder interpretations.
 
he's pestering bartek's answer too
 
I haven't ever touched a union. I kind of forget how they work. What happens when you access a... say, a float rather than int value, if it hasn't been assigned? I don't recall how the compiler does it.
 
The only reason why I use unions is for type-punning.
To be honest, I would never use a compiler that actually exploited the UB of union type-punning.
It's already part of the C standard. It should be included into C++ asap.
 
@EtiennedeMartel I left you a present in the screenshot of my cowboy_cast code. You should recognize some of the words. >_>
 
@ThePhD Wut
Shat.
 
2:05 AM
@Mysticial C++14?
 
Channeling some Applejack up in this bitch.
 
0
A: MrKernelKiller Mops.PRODUCTIONS Youtube

Frankston Ralphington IIIMay I be cynical for a bit? I hope you don't mind, but with Ben Marano's latest barrage of clueless jobations, I can't resist the urge to make a few cynical comments. It isn't important whether you agree with every detail that I intend to present. What matters is that you begin to realize that so...

^^ lolwut
 
Does anyone have the C99 standard on them?
 
Realistically, this is pretty much the practical truth of the situation. From a standpoint of C++11, there is already some leeway concerning PODs with the same layouts and people have been violating the idea for years now (but things will find unexpected uses, terrorists are terrorists until they seize control), since it has no repercussions beyond being a mere UB in the docs:
Although type-punning through a union is technically UB in C89 and C++, it is an extremely common idiom and is well-supported by all major compilers. — Adam Rosenfield 5 hours ago
 
If someone does can you tell me what §6.7.2.1 says? :(
 
2:09 AM
But what's written in the answer is the current state of things. I can't allow my opinion to be a part of an answer.
 
As a matter of fact- just kidding. Although, I don't know where you find any of the standards.
 
On Wiktionary, under "beat around the bush", there should have this answer as a definition. — Etienne de Martel 7 secs ago
@ThePhD So, should I understand that you started watching it?
 
@Mysticial Do you think I should add a paragraph about the practical truth?
 
@DomagojPandža It would definitely make your answer better. But be prepared to get downvotes from the pedents.
 
2:14 AM
Yeah, I would hit myself in the ass. Damned if I do, damned if I don't. It just pisses me off knowing that downvoters take the guilty pleasure themselves.
 
There's a sizable population of users who worship the standard and don't understand what "practical" means.
 
Is there a list of Save UBs™?
 
@EtiennedeMartel No! I'd never watch. IT PROVES NOTHING.
 
Stop fighting.
Embrace the magic of friendship.
 
Noooooo.
 
2:16 AM
> already explained by LightnessRacesInSpace and Mysticial in the comments of this answer and others.
 
Salami is good.
 
Being fat is great. Except when you have to go out on a saturday night.
 
Can anybody link me to that question about making a file in MS Paint, and opening it in notepad and it was code?
I cannot seem to find it.
 
Thanks.
 
2:19 AM
Unions do not exist for the sole purpose of type punning. Unions exist because sometimes you want to store one type of object and later retrieve it, and sometimes you want to store a different type of object and later retrieve it. — Eric Postpischil Jul 24 '12 at 22:09
 
I'm definitely never getting involved in union discussions || raw pointer discussions.
 
Unions are for noobs anyway.
 
user1357851
According to *this being overweight/obese is now the new norm in Australia, with more than half of the people being so.
 
@Rapptz It's the standard way to type-pun nowadays.
Or rather, for a long time actually.
 
I don't even understand the purpose of type punning
 
2:21 AM
1 hour ago, by StackedCrooked
@ThePhD http://coliru.stacked-crooked.com/view?id=f10f133d69a376131337f5f7a43e026b-d8a6f6e6988ed9869ff36c1f09c9e787
 
I've never wanted to do it and I see no purpose to
 
Ahahahahah
 
Oh, gawd.
 
@Rapptz I need to do it a lot. Like getting the bits of a float in an int.
 
2:22 AM
Hello, Sleepy World!
 
Although I do it mostly for type-punning SIMD and scalar types.
 
(10^n-1)/9? I recall those being repunits or whatever
 
type punning. strict aliasing. break. the rules.
 
leptoceratops?
 
@StackedCrooked I've seen a compiler break on strict-aliasing. But I've never seen it break on union type-punning.
 
2:23 AM
leptoceratops.
@Mysticial union type-punning is explicitly allowed by gcc and VS
 
@StackedCrooked ah
 
Even though it's UB according to the spec.
 
But they don't have any horns...let alone (n-1) of them
 
I could see (10^4-1)/9 being a *tri*ceratops
@MarcusStuhr well...there's that...
cept this leptocertops doesn't even have one horn...so n = 0
 
2:25 AM
Union type-punning works, has worked for many years. But the standard says what the standard says. I'll be the first to celebrate if it changes. I'll also sacrifice a goat for anonymous structs. But, considering the possible political shitstorm on SO, I'll rather just silence one disgruntled dude.
 
pft...stoopid wikipedia
 
1 hour ago, by ThePhD
user image
^ I committed it to my engine. <3
 
@DomagojPandža let's sacrifice a goat anyway...
 
Snarky guy in coffee queue eyes off my Bioshock Infinite t-shirt, suggests I "probably haven't even played it". So I told him the ending.
2
 
@DomagojPandža Yep. Which is why this answer is completely wrong:
6
A: Don't understand the output when using Unions in c++

David SchwartzYour code has a bug. The standard specifies that if you read from any union member other than the last one you wrote to, the results are unspecified. If you fix the code and comply with the standard, the mystery will go away. Most likely, the compiler is optimizing the union away and just using ...

MS supports union type-punning.
 
2:27 AM
@EtiennedeMartel I'd be eyeing her "tshirt", too
Who is she anyway?
hmm...a hot techie...I'm in love
 
Keep it in your pants.
 
Wait, is that her on the background repeat?
Holy shit, my behavior would officially be undefined around her.
 
54 secs ago, by Rapptz
Keep it in your pants.
 
Haha.
 
@Rapptz Who says I'm wearing pants?
 
2:31 AM
You all go gaga-eyes too easily. :P
 
Yeah she's decent if anything
 
For all you know, I'm sitting at the computer in my underwear...
 
I don't even have a computer. I'm typing this on my dick.
3
 
That deserves a star
 
@EtiennedeMartel What's your opinion of Bioshock: Infinite?
 
2:34 AM
I still need to finish the original...lol
 
@StackedCrooked I found the source that states that GCC allows union type-punning. But I can't find the one for MSVC.
Got any pointers?
 
I could never force myself to through BioShock. I really tried. Mass Effect pretty much spoiled other games for me.
 
@Mysticial Come on man. This is prone to jokes.
 
It's certainly an interesting concept
 
@Rapptz shhhh....
 
2:35 AM
yesterday, by Etienne de Martel
@kbok I'm waiting for a Steam sale. No way I'm shelling out 60$ for 8 hours of gameplay, no matter how entertaining they are.
 
@Mysticial Here, take a voidstar and 0xDEADBEEF. It's dangerous to go alone.
 
@Mysticial I've seen the docs for gcc. IIRC jalf mentioned once that both gcc and vs allow it. But I've never seen the VS docs that say this.
 
@EtiennedeMartel 8 hours..?
 
@DomagojPandža Does that mean you have to use a needle or something?
 
.__.
What the hell dude.
 
2:36 AM
8 hours sounds about right -- I only needed one sitting to finish the whole thing
 
That's pretty sad
 
@EtiennedeMartel or maybe an electron microscope?
 
Maybe 10, didn't really keep track
 
@Rapptz Even the big-game reviews said 10 and a half hours.
 
@StackedCrooked I'm pretty sure that you can demonstrate union UB using VS.
 
2:36 AM
@JPvdMerwe: GCC explicitly supports it though. So does MSVC. — jalf Nov 12 '10 at 12:43
 
but I don't recall the sample
 
@Code-Guru Although he can probably do it "by feel". After all, it's his dick.
 
Disregarding game content aside, what's with gameplay being shorter and shorter as the generations pass?
 
Now, jalf could have been wrong though :)
 
@EtiennedeMartel I use a scanning tunneling microscope. :$
 
2:37 AM
@Jalf Whenever you get the time, do you happen to have any links to official documentation that states that MSVC allows union type-punning?
 
@Rapptz Probably production costs
 
@Rapptz More money being diverted to the eye candy rather than the lifespan.
 
Why the hell is it so hard to track shit down in the documentation? All of the subtle and important bits gets swept under the rug.
 
Becomes costly to implement advanced 3D modeling, marketing, voice actors, programmers who can tie it all together, artists, designers, etc
 
Meh.
 
2:38 AM
Most "long" games are multiplayer, because you can get a longer lifespan out of the same content if it's multiplayer.
 
I'd rather play a game longer than look at eye candy
 
Games that have multiplayer tend to have shorter single player campaigns because there's financial incentive to get people playing MP as soon as possible
 
I'm there to play a game, not watch a god damn cinematic :/
 
@EtiennedeMartel Ad hominem may be thrust upon me, but I really do prefer longevity and gameplay experiences rather than eyecandy. For example, Skyrim was nothing special in the visual department -- just enough. And the gameplay. OMG. 300 hours spent since 11.11.11.
 
2:39 AM
Most games really just don't focus on content that much.
I mean, in the older days, you weren't focusing so hard on graphics.
 
@DomagojPandža I found Skyrim rather dull and repetitive.
 
So games were sold on content.
 
Right
 
Yeah I thought Skyrim was lame.
 
I also think there is much attributable to the advent of online play, too
 
2:40 AM
@Jalf I'm asking since I'm trying to prove that this answer is wrong and that the other answer is the correct one.
 
@EtiennedeMartel Really? You're not very much for the sandbox type of games?
 
Outside of the visuals there was nothing special about it.
 
Now, even with engines of today, there's a high focus on multiplayer and SHININESS WTF OMG
 
@DomagojPandža I enjoyed Fallout: New Vegas.
Quite a lot, in fact.
 
2:41 AM
So, a lot more energy goes into polish, and a lot less goes into making easter eggs and crazy random shit.
 
@EtiennedeMartel Awesome game! And you don't even care about the lacking visuals. :D
 
What I disliked with Skyrim was that, despite being technically an RPG, it was so fucking railroady.
 
I actually really disliked the new Tomb Raider game because of it
 
And even then, when you have to make those easter eggs, they have to be in SUPER DUPER HIGH-DEF 3D WTF like the rest of your game, so...
 
Why do I need to kill anyone?
Can't we talk?
 
2:41 AM
Felt like an interactive movie and not so much a game -- no real throwbacks to the original spirit of the series
Not even the title theme ;-;
 
Can't I have multiple ways to finish a quest?
No, it's only one fucking golden path.
 
@EtiennedeMartel Ahahahah, I love the way you think. People told me that I suck because I always try to paragon my way out of a fight.
 
@MarcusStuhr Sometimes I don't finish games because I don't want to be disappointed.
:(
 
@CatPlusPlus lol
 
Do you have any examples?
Bioshock: Infinite had an interesting ending at least
 
2:43 AM
Most recent one I can think is I put off finishing Skyward Sword because I didn't want to be disappointed, so I put it aside for about 3 months and then finished it.
Also haven't played games anymore in a long time :/
 
I have a hard time even starting that game
 
It's pretty good.
Ending didn't suck or anything.
 
(It sucked really hard)
(he's lying to yooou)
 
Nah
 
I spent like two hours hammering through multiple tomes of conversations in the initial town when I just wanted to get-to-the-damn-dungeons-already
haven't picked it up since
 
2:46 AM
@DomagojPandža I was the paragonest Shepard you could ever see.
 
asdhjadhkwdhaw
OH MY GOD
RAYMOND CHEN COMMENTED ON MY ANSWER
 
what game are we talking about?
 
<33333333333333333333333
 
I don't mind conversation/setting the mood in games :S
 
Mood setting/universe building/conversations are fine but the pacing felt off to me
 
2:47 AM
The mood in the beginning is supposed to be distraught
Ugh. I hope there are no 10-hour games.
Honestly the thought of that makes me sad
 
How long is your ideal game?
 
40-70 hours.
 
user1357851
unless it is multi-player
 
And that it offers reasons to return beyond multiplayer.
 
All the games I've liked I've put in 50 or so hours w/ quests and everything.
 
2:50 AM
I'm a big fan of singleplayer games. Multiplayer brings no joy to me.
 
But just the core should be at least 25-35
 
user1357851
multiplayer strategy games can be awesome
 
SC2 is the shit.
 
Multiplayer games are a hit or miss depending on the community.
No one wants to play a multiplayer game full of dicks.
 
it really depends on the game type
 
2:51 AM
@Rapptz FALSE, League of Legends
 
online Baldur's Gate is never gonna be that big a thing
 
I don't play LoL and I hate that game.
 
It's full of assholes, yet millions play it.
 
Because they're all assholes themselves
Just like CoD.
 
If I were in actual game production, I'd probably opt-in to so much choice that it would make the player's head spin from all the possibilities. Lower the visuals to more manageable levels, like Skyrim and try to improve it procedurally in terms of lighting, geometry improvement and shading.
 
2:53 AM
heh
you're adorable
 
Fallout New Vegas came out in 2008., sporting Gamebryo, looking like almost shit. Still one of my favorite games.
 
Anyway this made me miss games so I'm going to play some vidya.
 
"I'm going to make the player's head spin with so much choice... with my geometry shading!".
 
user1357851
multiplayer strategy games can be awesome because it takes time to build a good team, and there is bonding within the team, like you are together to serve a purpose ... in a virtual way ~shrug~
 
player choice comes from gameplay design
 
2:54 AM
Too much choice can be a bad thing
 
@DeadMG Ahahah, no. Not that. I may have expressed myself in the wrong way. I meant allowing technical things to become automated, in order to allow people to concentrate on actual gameplay design.
 
A limit of 3 is good
 
choice paralysis + lower average utility
 
@DomagojPandža I still enjoy playing SW:KotoR even though it looks like shit by todays standards. Why? Story is great, gameplay is good, and CHOICE :D
 
1
A: C# - How to open an Excel application?

Dot NETAdd this piece of code: myApp.Visible = true;

 
2:54 AM
@Borgleader Yes! :D
 
^^ wth?!?!
 
@Mysticial Ahahah, I read the line as "Add this piece of shit:"
 
lol he commented on himself too
 
Self-answer with a "thanks!" comment.
 
@Borgleader I've been wasting thousands of hours lately playing Baldur's Gate and Baldur's Gate 2.
 
2:56 AM
AHAHAHHAH. I upvoted his answer.
 
@DomagojPandža hold on...
I think it might have been the result of a merged sockpuppet account.
Don't upvote.
48
Q: A sock with 28 rep points just deleted my comment?

Won'tK, so I left a quick comment on this question to a user who didn't seem to understand how moderator flags worked. Moderators are janitors. You flag us when someone throws up in the hallway. We are not professors, tasked with grading answers to questions. If someone provides an unsatisfactory...

 
What's a sockpuppet?
 
Account to upvote yourself.
 
And second account you use to upvote yourself or commit other sorts of fraud.
 
2:59 AM
So how'd you find that?
 
lol EA
 
@Rapptz I came from the meta post first. So I knew the guy had sockpuppets. But it didn't occur to me that mods can merge sockpuppet accounts together.
*or they used to be able to.
Now it's a dev-only power I think.
 

« first day (909 days earlier)      last day (4037 days later) »