Click here to Skip to main content
15,888,351 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Misaligned elephants Pin
RafagaX24-Jul-13 4:41
professionalRafagaX24-Jul-13 4:41 
GeneralRe: Misaligned elephants Pin
Sentenryu24-Jul-13 6:08
Sentenryu24-Jul-13 6:08 
GeneralRe: Misaligned elephants Pin
BiggerDon24-Jul-13 2:15
BiggerDon24-Jul-13 2:15 
GeneralRe: Misaligned elephants Pin
Gary Wheeler24-Jul-13 0:13
Gary Wheeler24-Jul-13 0:13 
GeneralRe: Misaligned elephants Pin
YvesDaoust23-Jul-13 22:51
YvesDaoust23-Jul-13 22:51 
GeneralRe: Misaligned elephants Pin
Matthew Faithfull23-Jul-13 23:10
Matthew Faithfull23-Jul-13 23:10 
GeneralRe: Misaligned elephants Pin
Ralph Little24-Jul-13 6:32
Ralph Little24-Jul-13 6:32 
GeneralRe: Misaligned elephants Pin
Member 460889824-Jul-13 10:02
Member 460889824-Jul-13 10:02 
Is this on a 16-bit, 32-bit or 64 bit environment? If you are using Visual Studio, check the preprocessor directives in all the projects. Also check the code generation struct member alignment. I've had this before: all projects just used default settings except some were VS6, some were VS2003 and some were VS2005. I just got random unexplanable crashes, so, like you, I decided to look at the sizeof things and they were very different. Nowadays I avoid such things by not having inline functions. It may run slower but at least you don't spend weeks trying to figure out stuff like this.
GeneralRe: Misaligned elephants Pin
SortaCore24-Jul-13 0:04
SortaCore24-Jul-13 0:04 
GeneralRe: Misaligned elephants Pin
rbocquier24-Jul-13 0:39
rbocquier24-Jul-13 0:39 
GeneralRe: Misaligned elephants Pin
Matthew Faithfull24-Jul-13 0:53
Matthew Faithfull24-Jul-13 0:53 
GeneralRe: Misaligned elephants Pin
Stuart Dootson24-Jul-13 5:18
professionalStuart Dootson24-Jul-13 5:18 
GeneralRe: Misaligned elephants Pin
Matthew Faithfull24-Jul-13 5:24
Matthew Faithfull24-Jul-13 5:24 
GeneralRe: Misaligned elephants Pin
jschell24-Jul-13 9:26
jschell24-Jul-13 9:26 
GeneralMessage Automatically Removed Pin
Brisingr Aerowing19-Jul-13 6:46
professionalBrisingr Aerowing19-Jul-13 6:46 
GeneralRe: Extension Methods Pin
Andrew Rissing19-Jul-13 7:06
Andrew Rissing19-Jul-13 7:06 
GeneralRe: Extension Methods Pin
Richard Deeming19-Jul-13 7:20
mveRichard Deeming19-Jul-13 7:20 
GeneralRe: Extension Methods Pin
Gary Wheeler19-Jul-13 7:21
Gary Wheeler19-Jul-13 7:21 
GeneralRe: Extension Methods Pin
TnTinMn19-Jul-13 8:00
TnTinMn19-Jul-13 8:00 
GeneralRe: Extension Methods Pin
Lutosław19-Jul-13 8:08
Lutosław19-Jul-13 8:08 
GeneralRe: Extension Methods Pin
Richard Deeming19-Jul-13 8:55
mveRichard Deeming19-Jul-13 8:55 
GeneralRe: Extension Methods Pin
Lutosław19-Jul-13 9:06
Lutosław19-Jul-13 9:06 
GeneralRe: Extension Methods Pin
PIEBALDconsult19-Jul-13 8:09
mvePIEBALDconsult19-Jul-13 8:09 
GeneralRe: Message Automatically Removed Pin
lewax0019-Jul-13 9:35
lewax0019-Jul-13 9:35 
GeneralRe: Message Automatically Removed Pin
ZurdoDev19-Jul-13 10:22
professionalZurdoDev19-Jul-13 10:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.