|
lol this bug |
Mark Oates
Member #1,146
March 2001
|
{"name":"611455","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/3\/d37a6646de7f55bd7517750c811cb641.png","w":550,"h":344,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/3\/d37a6646de7f55bd7517750c811cb641"}
-- |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Try this one: EAGLE_ASSERT(LoadConfig()); My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
bamccaig
Member #7,536
July 2006
|
Edgar Reynaldo said: Try this one: That's a stupid post. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Edgar Reynaldo
Major Reynaldo
May 2007
|
huH? It only calls LoadConfig() in Debug Mode
My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
bamccaig
Member #7,536
July 2006
|
Without the definition for EAGLE_ASSERT that's impossible to infer. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Edgar Reynaldo
Major Reynaldo
May 2007
|
But you can reasonably infer it calls assert on a false return. And if you define NDEBUG, it never gets called. Likewise, if EAGLE_DEBUG is not defined, EAGLE_ASSERT compiles away to nothing, hence it's like you never called LoadConfig() at all in release mode. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
bamccaig
Member #7,536
July 2006
|
Which is only a bug if you know what LoadConfig() does and you know the context of this statement. For all we know, it's a unit test for EAGLE_ASSERT. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Edgar Reynaldo
Major Reynaldo
May 2007
|
If it's an assert, then it's testing a boolean statement. What do you think LoadConfig does but load a configuration? If you don't do it, then obviously you're gonna have problems. <box> Think outside the box bambams. </box>
My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Dizzy Egg
Member #10,824
March 2009
|
1
2int iLoop;
3
4...
5
6void checkDat()
7{
8 for(iLoop = 1;iLoop < 20;iLoop++)
9 {
10 checkBytes(&b);
11 }
12}
13
14void checkBytes(int * b)
15{
16 for(iLoop = 1;iLoop < 8;iLoop++)
17 {
18 if(b < 1)
19 {
20 printMessage("byte out of range");
21 }
22 }
23}
---------------------------------------------------- |
bamccaig
Member #7,536
July 2006
|
Edgar Reynaldo said: If it's an assert, then it's testing a boolean statement. What do you think LoadConfig does but load a configuration? If you don't do it, then obviously you're gonna have problems. Software development is not the place for assumptions. Edgar Reynaldo said:
Think outside the box bambams. <box> </box>
FTFY. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Chris Katko
Member #1,881
January 2002
|
I've had so many silly bugs before! I just wish I could remember them for here. For the longest time, (and I posted a thread years ago about this), I never realized (or always forgot!) that C/C++ treat different numbers... as different numbers. 5; //int 5 5.0; //double 5F; //float 5.0F; //float So I'd run into errors when I combine ints and floats all the time when I have a bunch of multiplies and divides, but no .0, it wipes it all away (or sometimes just hard-to-notice parts) to zero. It also changes based on the position of the arguments. No C/C++ book I read growing up ever stressed that issue except (at best) showing a simple diagram with no application explanation about implicit conversion rules. IIRC, D doesn't allow implicit conversion except in the most obvious of cases and will flag it. But it definitely allows it for custom unit types... I don't know. It's been forever since I looked into this problem I used to subtle bugs from all the time. https://wiki.dlang.org/Implicit_conversions_in_user_types C#... allows you to define a user-defined implicit conversion? That's... kind of cool though the opposite idea. Never heard of it till I just googled it: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/implicit I think the issue pops up the most (or only) when you divide by an int, even when you intend to have float precision. So if you're doing something like dividing by the TILE_WIDTH (int, pixels in a tile) but want the fractional part, it goes poof. -----sig: |
Polybios
Member #12,293
October 2010
|
I had one bug where I accidentally had typed something like a*+b in a more complex formula all written without spaces . I meant a+b but it took me hours to spot it and I wondered that it was even valid. |
l j
Member #10,584
January 2009
|
Polybios said: I had one bug where I accidentally had typed something like a*+b in a more complex formula all written without spaces . I meant a+b but it took me hours to spot it and I wondered that it was even valid. I think it's valid because there is one binary(multiplication) and one unary(unary +) operator there. Not sure what the unary + operator is useful for though... At least in most languages, in JS it's used to convert a value to a Number. My most annoying bug is probably where I typed 1 instead of l using a typeface that rendered the characters exactly the same.
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
Get back in your box. <box> bambams </box>
My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
AramisL
Member #16,723
August 2017
|
I'm the mother of all the bugs in my programs |
Chris Katko
Member #1,881
January 2002
|
I Am a Strange Loop -----sig: |
Edgar Reynaldo
Major Reynaldo
May 2007
|
People are strange when you're a stranger Faces look ugly when you're alone Women so wicked when you're unwanted Streets are uneven when you're down When you're strange...
My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Peter Hull
Member #1,136
March 2001
|
How about this one from the set up code for a microcontroller?
|
bamccaig
Member #7,536
July 2006
|
I ... cannot see that one. It must require domain-specific knowledge? -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Audric
Member #907
January 2001
|
portb_init is probably the default value for PORTB, but it overwrites PORTA instead. |
bamccaig
Member #7,536
July 2006
|
Ah, good catch. By then my eyes must have been lazy. I missed that. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Mark Oates
Member #1,146
March 2001
|
Peter Hull said: I didn't make it but I did find it after a lot of staring at the screen. I caught it. It's lol approved. -- |
|