The Official Status Thread
-
@Tsaukpaetra said in The Official Status Thread:
@dkf said in The Official Status Thread:
@Tsaukpaetra said in The Official Status Thread:
Changing it around so
Subsystem(InSubsystem)
was last in the list fixed it. Somehow.I never wrapped my head around the rules for when it matters either. Initialisers post-date when I learnt C++…
Yeah. Apparently it hasn't mattered for years until just now as I updated Visual Studio to 2017.
Thankfully that appears to be literally the only time this was (apparently) wrong.
The order has always mattered but it’s normally a warning. You must’ve enabled VS’s equivalent of
-Werror
.
FYI, the rule is that members are initialized in the order they are declared in the object, regardless of the order of the initializers. Thus, you usually get a warning when they disagree, because you probably assume they get initialized in the order of the list and it can come back to bite you when what you wanted to do isn’t what happens.Contrived example:
class Person { public: Person(string name) : name_(name), initials_(getInitials(name_)) {} private: // ... string initials_; string name_; }
Unlike what’s the intention,
initials_
gets initialized first and thusgetInitials(name_)
will not have the correctname_
.EDIT: When you want to demonstrate wrong order, you should actually put things in the wrong order!
-
@topspin said in The Official Status Thread:
You must’ve enabled VS’s equivalent of
-Werror
.I have done no such thing. Or, in other words, defaults have changed.
FYI, the rule is that members are initialized in the order they are declared in the object, regardless of the order of the initializers. Thus, you usually get a warning when they disagree, because you probably assume they get initialized in the order of the list and it come back to bite you when what you wanted to do isn’t what happens.
Right: a warning. Not a build-stopping error... I would still fix it if it was a warning (the Linux builds actually started clueing me in to this, actually).
The number of warnings in my parts of the code is approximately zero, except for "variable declared but never used" warnings.
-
@Tsaukpaetra said in The Official Status Thread:
I have done no such thing. Or, in other words, defaults have changed.
Probably, no idea. .
-
Status: I hate subdermal bacterial pimples. Especially the ones in pressured surfaces, where inflammation and further irritation is likely.
Tomorrow's status: not sitting.
-
@Tsaukpaetra @dkf the rules are simple: the fields are always initialized in the order they're declared in the class body. If the initialization list has different order, the compiler will treat it as if it was in the right order - leading to great confusion when using one field's value in another's initializer. GCC and Clang had this warning since forever - I'm surprised to learn VS only got it now, considering they're usually miles ahead in diagnostics.
This warning is new in Visual Studio 2017 version 15.3, and is off by default. Use /Wall to enable all warnings that are off by default, or /wn5038 to enable C5038 as a level n warning.
So yes, you definitely do have /WX flag. And also /W4 or /Wall, because otherwise you wouldn't get this warning at all.
-
@Gąska said in The Official Status Thread:
So yes, you definitely do have /WX flag. And also /W4 or /Wall, because otherwise you wouldn't get this warning at all.
It may be enabled now but not as a direct action by me.
I blame Unreal Engine.
-
@Tsaukpaetra said in The Official Status Thread:
"variable declared but never used" warnings
We use this macro in our code for dealing with those:
#define use(x) do {} while ((x)!=(x))
(No, we don't have
float
ordouble
in our code; there are noNaN
s to spoil the party.) That's easier than telling the compiler to ignore arguments that have to be there because of type signatures but aren't needed in a specific case.
-
@dkf ...you know you can just cast to void?
-
@Gąska said in The Official Status Thread:
you know you can just cast to void?
I tend to use that for functions that return a value that I don't care about. (I didn't write the macro; I just
use
it…)
-
@dkf said in The Official Status Thread:
That's easier than telling the compiler to ignore arguments that have to be there because of type signatures but aren't needed in a specific case.
We tend to use
#define _UNUSED __attribute__((unused))
which decorates the argument in the function definition. (gcc/clang)
-
@PleegWat said in The Official Status Thread:
@dkf said in The Official Status Thread:
That's easier than telling the compiler to ignore arguments that have to be there because of type signatures but aren't needed in a specific case.
We tend to use
#define _UNUSED __attribute__((unused))
ILLEGAL USE OF RESERVED IDENTIFIER!!!
-
@Gąska said in The Official Status Thread:
ILLEGAL USE OF RESERVED IDENTIFIER!!!
Not a problem when you're building freestanding mode. Of course, in that case you can't actually assume that you have a libc available, and the OS is probably custom too…
-
Status: three eggs hatched today.
-
God damn I hate expensive restaurant food
-
@anonymous234 stop eating at restaurants?
-
@HardwareGeek: condolences
-
@Tsaukpaetra said in The Official Status Thread:
"variable declared but never used" warnings.
Oh, we have those (with
-Werror
) because of variables that are used only in debug messages, and the debug messages are macros that expand to nothing if it's not a debug build.-Wno-unused-but-set-variable
to the rescue.
-
@HardwareGeek said in The Official Status Thread:
It's 01:30, I haven't had any dinner, it's too late to eat, and I need to go to bed, but I'm going to have trouble sleeping.
Yeah, about two hours, maybe a little more.
I went to bed, but wasn't ready to go to sleep, so I distracted myself for a while studying Greek. I finally felt like trying to sleep and turned out the light; as I did so, I happened to notice the clock said 2:22. I didn't fall asleep right away; I never do, even when I'm not stressed, unless I'm really sleepy. Every time I thought of her face on the couch beside me at the vet's office, I'd get a little jolt of adrenaline that would bring me back to fully awake.
I finally fell asleep, I'd guess probably around 03:00. Woke up again about 05:00, needing to pee and in pain from my own medical issues. Got up a little after 06:00. It's now a little after 08:00. I've eaten breakfast, so my stomach isn't hurting from emptiness; if only the rest of me would stop hurting. I need to get some more sleep before I have to go to church this afternoon; it's hard to do my volunteer job when I'm falling asleep. But I'm not sleepy enough to overcome my emotional agitation right now; maybe I'll kill some dragons or study some more Greek to calm down, first. (:why_not_both.xls:)
-
@Gąska said in The Official Status Thread:
@dkf ...you know you can just cast to void?
Evil idea:
operator void
with side effects.Not going in the evil ideas thread because it doesn’t actually get invoked. (Probably for this very reason)
-
@HardwareGeek you have my most sincere condolences. Remember to take care of yourself first, your family second, and other things (like volunteer work) only after the first two are okay.
Status: Pondering why Cigna approves my fiancee staying in a psych ward when she's merely depressed with no suicidal ideation, but says she should be discharged to a "less restrictive" level of care when she comes up with three detailed "departure" plans, with contingency mitigation, and expresses desire and intent to act on them.
-
Status: New lenses day. I've gotten these enough that I'm not not certain whether the little bits of vertigo & such from adjustments actually happen, or are just placebo effect since I'm expecting them to happen.
-
@Gąska Family and social obligations insist I do.
-
@Tsaukpaetra said in The Official Status Thread:
@Parody said in The Official Status Thread:
Status: Misread something. Bah.
I unread something else.
The funny thing: my post was (going to be) about the initializers-are-in-the-order-of-declaration-in-the-class-not-in-the-constructor-definition thing but I couldn't find a path from there to an error. I spaced the possibility of an advisory warning being raised to one.
-
Status: Just found an interesting business model offered by a nearby store - instead of buying a (moderately expensive) device, you lease it. You can decide how long the lease is supposed to run (1, 3 or 12 months with corresponding leasing rates)
So, for instance, if you're unsure if a Vive Pro (1300€) is something for you, you can instead lease it for a 100€ for one month. After this month you could then buy the device (plus a fee) or switch to a 12 months lease or simply keep the device whereupon the lease is automatically extended by one month increments. If your total fees have reached the recommended sales price you can then pay the fee for three months and have thus bought the device.
Interesting model for things which are changing rapidly. Also, they include insurance (i.e. you pay only 10% of repair fees in case something breaks).
-
@topspin said in The Official Status Thread:
Evil idea:
operator void
with side effects.You are a very bad man, and should feel proud of yourself.
-
@Cursorkeys Day three complete, they like me. Dinner on Monday with a talk over the compensation package.
I've never written a resignation letter before, this is going to be interesting.
-
@Cursorkeys said in The Official Status Thread:
I've never written a resignation letter before, this is going to be interesting.
You could go the classic route and be insulting in an obtuse way?
I don’t know half of you half as well as I should like; and I like less than half of you half as well as you deserve.
-
Status: Chuckling.
-
@izzion said in The Official Status Thread:
Status: New lenses day. I've gotten these enough that I'm not not certain whether the little bits of vertigo & such from adjustments actually happen, or are just placebo effect since I'm expecting them to happen.
Same. For me it's cross-eyedness.
-
Status it's like I was reliving Inception this morning. Layer upon layer of dream after dream…
-
status: micro server build finally completed (sans an extra SSD I forgot to order)!
I only needed two RMA'd motherboards, five sticks of RAM, four CPUs, and three months of time! Oh, and a fan mod because the stock cooler is shorter than the "low profile" ones I also bought, and I had to cut off one of the plastic legs off to clear the drive caddy backplane that was sticking out...
Next build won't be in this form factor. :
-
@Tsaukpaetra said in The Official Status Thread:
Next build won't be in this form factor. :
It reminds me of when I got a second-hand Shuttle computer:
https://www.shuttle.eu/_archive/older/en/prod/xpc/600/sn41diag.jpgAt first I thought "heh, it looks cute, and it saves space". That was until I wanted to replace components, and experienced how painful it is to disassemble. That, and finding parts that fit, and paying a premium when the power supply blew up (because the form factor is custom).
Never again.
-
Status: Voted.
-
@Rhywden Status: Can't vote because I have classes all day.
-
@Gąska aren't polls open untill 10pm? I voted after work on Thursday
-
@Jaloopa Varies per country, but 'Can't vote because I have classes all day' sounds like your constitutional rights are being violated.
-
@PleegWat Also, classes on a sunday?
-
Status: We have the rare job that has to be done on a Sunday and I am the only one who is not hungover.
-
@Jaloopa said in The Official Status Thread:
@Gąska aren't polls open untill 10pm?
Only 8PM here. And anyway, the last class ends 9:30.
-
@Rhywden said in The Official Status Thread:
@PleegWat Also, classes on a sunday?
How else am I going to get my degree with a full time job?
-
@Polygeekery said in The Official Status Thread:
Status: We have the rare job that has to be done on a Sunday and I am the only one who is not hungover.
-
@izzion said in The Official Status Thread:
@Polygeekery said in The Official Status Thread:
Status: We have the rare job that has to be done on a Sunday and I am the only one who is not hungover.
Working on Sunday or not being hungover?
-
@Polygeekery
:whynotboth.jpg:
-
@Gąska Yes, but all of the Sunday without making space for something as important as elections?
-
@Rhywden welcome to Poland.
-
-
@Rhywden said in The Official Status Thread:
something as important as elections?
European deputies elections, i.e. electing a small fraction of a group of people who have very little power anyways. And even if they had, major reforms would require unanimity among all the member states, which is Not Going To Happen. So many people put quotation marks around "important".
-
@Gąska said in The Official Status Thread:
@Rhywden welcome to Poland.
Don’t you have a post office for absentee voting?
-
@topspin said in The Official Status Thread:
@Gąska said in The Official Status Thread:
@Rhywden welcome to Poland.
Don’t you have a post office for absentee voting?
The answer will be "It's Poland", I suppose, following a recent trend of argumentative points by @Gąska
-
@topspin said in The Official Status Thread:
@Gąska said in The Official Status Thread:
@Rhywden welcome to Poland.
Don’t you have a post office for absentee voting?
We do. I don't. Didn't sign up in time.