WTF Bites
-
I'd expect
char const **
is good enough,char const * * const
is pedantic, and what he wrote is supremely pedantic.What, so you agree changing the characters is bad but you don't mind accidentally changing the pointers to the characters?
char const *const *
is good,char const *const *const
is pedantic. But I mean there's not much of a reason not to do add all theconst
s I can if I'm not going to change anything - I'm of the mind that stuff should beconst
by default unless you explicitly mark itmutable
. So yes I am pedantic :p
-
@mott555 Thankfully there is now the
[[maybe_unused]]
attribute that I forgot about until a few seconds ago.
-
@mott555 Thankfully there is now the
[[maybe_unused]]
attribute that I forgot about until a few seconds ago.Ah, well, most of our code is C, not C++.
-
since I wasn't using it, it resulted in a warning about unused variable.
Our codebase is littered with stuff like
/* Shut up Visual Studio compiler */
someUnusedVar = someUnusedVar;
I was always fond of
(void)someUnusedVar;
. There's something about casting variables (in)to (the) void.
-
since I wasn't using it, it resulted in a warning about unused variable.
Our codebase is littered with stuff like
/* Shut up Visual Studio compiler */
someUnusedVar = someUnusedVar;
I was always fond of
(void)someUnusedVar;
. There's something about casting variables (in)to (the) void.int main(int argc __attribute__((unused)), char **argv __attribute__((unused))) {
-
I'd expect
char const **
is good enough,char const * * const
is pedantic, and what he wrote is supremely pedantic.What, so you agree changing the characters is bad but you don't mind accidentally changing the pointers to the characters?
Accidentally? You'd have to go out of your way to do that. "Protect against Murphy, not Machiavelli".
I'm of the mind that stuff should be
const
by default unless you explicitly mark itmutable
.I agree to that, but the verbosity / "this is actually going to happen, ever" trade-off is negative here (IMO).
-
since I wasn't using it, it resulted in a warning about unused variable.
Our codebase is littered with stuff like
/* Shut up Visual Studio compiler */
someUnusedVar = someUnusedVar;
Amateur.
#pragma warning(disable : 4100)
-
If you use clang or gcc you may want to try
-Wconversion
or-Wshorten-64-to-32
as they are not included in-Wall
or-Wextra
.I've always loved this.
Oh, we have a nice flag so that you get all possible warnings, it's called, guess what,
-Wall
. Isn't that nice and easy?
Well, actually, that's not quite exactly all warnings, because raisins. So, uh, what about we give you another flag-Wextra
so that you'll really-really-pinky-promise get all warnings?
Muahahaha! We lied! There are still more warnings! And yeah, about having a flag that includes them all? Fuck you, this is work.
-
If you use clang or gcc you may want to try
-Wconversion
or-Wshorten-64-to-32
as they are not included in-Wall
or-Wextra
.I've always loved this.
Oh, we have a nice flag so that you get all possible warnings, it's called, guess what,
-Wall
. Isn't that nice and easy?
Well, actually, that's not quite exactly all warnings, because raisins. So, uh, what about we give you another flag-Wextra
so that you'll really-really-pinky-promise get all warnings?
Muahahaha! We lied! There are still more warnings! And yeah, about having a flag that includes them all? Fuck you, this is work.At this point you'd enter PHP's
-Wreallyallerrorsandwemeanitthistime
territory ;)
-
@rhywden I understand why they might not want to 1) put all warnings into a single flag and 2) not add warnings to an existing flag from one version to the next. But really, they picked the worst possible way out of this: something that lets you believe that there is such a flag, while not working, and no actual straightforward way to get all of them. Even the usability horror of just calling the flags
-Wgroup1
and-Wgroup2
would have been better...
-
int main(int argc __attribute__((unused)), char **argv __attribute__((unused))) {
This. Though we
#define
it to__UNUSED__
. Which I think is a violation of the standard.
-
@scarlet_manuka said in WTF Bites:
That was yesterday. I haven't had any further word from them, so I have no idea yet on when (or indeed whether) they're going to send me a replacement modem. I should probably call them again today, I guess.
In the US, I'd just drive to Best Buy and Fry's and pick one up. As an added bonus, stop paying the stupid $5/month "model rental fee" from the ISP.
Is that not an option there?
-
@pjh :needs_more_const.pgm:
-
Status: So I've been pestering Perforce support because recently certain clients are getting weird issues when
fstat
ing files (). We've been back and forth with things like "are you running with antivirus" and "are there any other programs accessing the files" (there aren't).I've been escalated to a higher-than-tier1 rep, and he has me
chmod
ing the files to 600 (which is fine, nobody else is expecting to access these things anyways...), and then we have statements like this:WTF even?!?!
-
@heterodox said in WTF Bites:
@pjh Optimistically, I would expect it not to compile and say "You're a dumbass" but that's probably not the case sooo... will test in MSVC shortly.
GCC for reference:
$ make main g++ main.cpp -o main main.cpp: In function βint main(int, char**)β: main.cpp:7:5: error: conflicting declaration of C function βint main(int, char**)β int main(int argc, char** argv){ ^~~~ main.cpp:2:5: note: previous declaration βint main()β int main(void){ ^~~~ <builtin>: recipe for target 'main' failed make: *** [main] Error 1
MSVC for reference
test.cpp(7): error C2731: 'main': function cannot be overloaded main.cpp(7): note: see declaration of 'main'
-
-
I was always fond of (void)someUnusedVar;. There's something about casting variables (in)to (the) void.
Our codebase has this little macro:
#define use(x) do {} while ((x)!=(x))
Fortunately, our codebase also doesn't have much floating point math in C. ;)
-
Just got a report from one of our customers. Some dumbass firm they hired is telling them the payment page isn't "pci secure enough".
Why?
Well, you see, on the payment page, where you enter the credit card information. After you type it in, if I open up developer tools, I can see the value. Therefore the credit card number is being stored on {customer's} website.
way
Also, when you click SUBMIT to make the payment, if I look at Fiddler, I can see the credit card number in the POST.
do you have any fucking idea how the internet actually works?
-
@lorne-kates said in WTF Bites:
Just got a report from one of our customers. Some dumbass firm they hired is telling them the payment page isn't "pci secure enough".
Why?
Well, you see, on the payment page, where you enter the credit card information. After you type it in, if I open up developer tools, I can see the value. Therefore the credit card number is being stored on {customer's} website.
way
Also, when you click SUBMIT to make the payment, if I look at Fiddler, I can see the credit card number in the POST.
do you have any fucking idea how the internet actually works?We, a jury of your peers, find you completely innocent.
-
We, a jury of your peers, find you completely innocent.
And the dumbass firm totally incompetent
-
@timebandit said in WTF Bites:
We, a jury of your peers, find you completely innocent.
And the dumbass firm totally incompetent
After @Lorne-Kates was done with them, they didn't exist.
-
@lorne-kates said in WTF Bites:
do you have any fucking idea how the internet actually works?
Doesn't it involve insecure things like computers outside your network connecting to your site?
-
@lorne-kates said in WTF Bites:
do you have any fucking idea how the internet actually works?
Doesn't it involve insecure things like computers outside your network connecting to your site?
WAIT! Was that company the one who supplied the TCP/IP information for that paper mentioned elsewhere?
-
After @Lorne-Kates was done with them, they didn't exist.
Fortunately, the ground is thawed now
-
@lorne-kates said in WTF Bites:
Also, when you click SUBMIT to make the payment, if I look at Fiddler, I can see the credit card number in the POST.
That should be possible if and only if Fiddler is set to spoof HTTPS. Aka, warning click-throughs up the wazzoo.
If he saw the CC# without HTTPS spoofing, then yes that is a valid concern.
-
@tsaukpaetra said in WTF Bites:
@tsaukpaetra said in WTF Bites:
WTF even?!?!
My reply:
Too much?
Possibly; Word - at least - is apparently unimpressed with whatever you're using instead of punchcards or Winchester drives.
-
WAIT! Was that company the one who supplied the TCP/IP information for that paper mentioned elsewhere?
Oh yeah, since someone else found an open access copy of that paper, we can start a thread for further fisking of that if anyone wants.
-
@tsaukpaetra said in WTF Bites:
@tsaukpaetra said in WTF Bites:
WTF even?!?!
My reply:
Too much?
Possibly; Word - at least - is apparently unimpressed with whatever you're using instead of punchcards or Winchester drives.
Word?
-
@tsaukpaetra said in WTF Bites:
Word?
Yeah, don't you write your emails in Word, then take a screenshot and copy that in Outlook?
-
@timebandit said in WTF Bites:
@tsaukpaetra said in WTF Bites:
Word?
Yeah, don't you write your emails in Word, then take a screenshot and copy that in Outlook?
I literally have none of the above-mentioned programs installed on my PC at present. No, I have something a bit worse than that:
-
https://www.youtube.com/channel/UCiH3pNHnbeZIH5qyHi9IMgw/videos
Somehow this account has uploaded all of Futurama in hour-long 720p videos, with no apparent distortion of any kind.
I guess Content ID is not really that strict. Or working at all.
-
@anonymous234 said in WTF Bites:
with no apparent distortion of any kind.
Aww, I was going to suggest
-
@blakeyrat said in WTF Bites:
stop paying the stupid $5/month "model rental fee
Where can I rent a model for $5/month? How much to rent a supermodel?
-
-
@blakeyrat said in WTF Bites:
In the US, I'd just drive to Best Buy and Fry's and pick one up. As an added bonus, stop paying the stupid $5/month "model rental fee" from the ISP.
Is that not an option there?
If I had to pay a modem rental fee to my ISP, then yes, I'd probably do the same. Since I don't, and their modem offering looks like it'll do everything I want it to, I'd rather save the money.
-
-
This post is deleted!
-
Someone somewhere decided it was a good idea to port DOSBox to DOS.
DOSBox uses the SDL library and has been ported to many operating systems. ... Using the HX DOS Extender, it can even run in DOS.
-
@mott555 DOSBox does have a feature that lets you choose how quickly to run an emulation so that games that depend on a slow CPU to be playable can still be played on faster computers. That would be about the only reason I can think of to run DOSBox on DOS.
-
@mott555 Seems like an easy task
int main() { printf("You're in dos now\n"); return 0; }
-
I have to make one relatively minor update to a data importer to allow it to handle a different file type. Should be just a few lines of code. So I dig into the existing code to see what's going on. There's a Dialog class that isn't a dialog which gets some data from another dialog, then passes it into a separate logic class for the not-a-dialog, which creates a custom thread class, which creates a backing object class for the custom thread class, which then uses a data importer class, which doesn't actually import data but instead holds an inner data importer interface, which only has a single concrete implementation that is provided by a factory class.
Great. My anticipated three-line code change now requires me to write eleventy billion new classes if I want consistency with the rest of the application.
-
@mott555 And it appears that all this may have been done in order to provide slots/signals for a Qt progress bar during the import. The awesome part is there's no progress bar, and the innermost class never raises the progress signals anyway.
-
@mott555 Reminds me of a TI-82 basic game which took about a second and a half to load and had a load progress bar. All 1.5 seconds of loading time was taken up drawing the progress bar.
-
@mott555 You'd think with something this layered involving interfaces and factories, the file type only matters to the innermost layer, and I could add my new importer by modifying the factory and creating a new interface implementation. Nope! It matters to most of them! So I have to layer the layers!
It's like someone read a book on design patterns and brainlessly stuffed every single one everywhere, making a tangled ball that totally negates the pros of using such design patterns.
-
-
@mott555 Ugh. So the factory method requires a reference to the data being imported, which is a specific C++ type locked to the specific file type rather than some interface. Which means the factory cannot be used to spit out classes for other file types, and it's a totally useless factory.
-
@mott555 DOSBox does have a feature that lets you choose how quickly to run an emulation so that games that depend on a slow CPU to be playable can still be played on faster computers. That would be about the only reason I can think of to run DOSBox on DOS.
That, and maybe it emulates some hardware that your computer might not have?
-
@anotherusername Like old sound cards
-
@timebandit yeah. Although, it doesn't explain why you'd want to boot into DOS to run it... your regular OS should run DOSBox perfectly well.
also, that HX DOX extender thing? It's basically a freakin' Win32 emulator...
-
https://i.imgur.com/TLGXACK.png
Well, I clicked it accidentally while trying to prepare a screenshot. It told me it would access the game configurations directly, and I told it to fuck off, because I don't use Intel for any of my graphics. Now I've got this lovely window sitting here with no sign of loading or going away and no X button.
https://i.imgur.com/v4OGKz8.jpg