Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

POST THEM CFLAGS

Name: ALFA-RICER 2009-11-16 13:54

IT'S BEEN A LONG TIME SINCE THE LAST DISCUSSION WE HAD ABOUT THIS...

Name: Anonymous 2009-11-17 21:45

SPEED = -O3 -ffast-math -fomit-frame-pointer -flto -fwhole-program

WARNINGS = \
  -Wall -pedantic -Wc++-compat -Wstrict-aliasing=2 -Wextra \
  -Wtraditional -Wconversion -Wshadow \
  -Wcast-qual -Wcast-align -Wwrite-strings \
  -Waggregate-return -Wstrict-prototypes -fno-common \

CFLAGS = -std=c99 -fgnu89-inline $(SPEED) $(WARNINGS)


yeah bitches, i am the hardcore

Name: Anonymous 2009-11-17 23:15

>>36
Where's -Werror? Surely you, being the hardcore, don't run any code that isn't perfect?

Name: Anonymous 2009-11-17 23:21

>>37
I don't need it, as I only write perfect code.

Name: Anonymous 2009-11-18 0:41

>>37
>>36-san here (not >>38), actually I usually leave -Werror off; having to fix minor oversights like signed/unsigned conversions before running code breaks flow far too much, but they're definitely worthwhile fixing before committing code, so no point in ever turning it on. I've considered activating only some, like -Werror=implicit, but there are too many to bother. SPEED is also simply -g during development obviously.

I kinda wish there was a -Werror for specific Objective-C warnings though. So many warnings that should be errors, and so many warnings that shouldn't exist...

Name: Anonymous 2009-11-18 2:00

-ffunction-sections

Name: Anonymous 2009-11-18 6:04

>>38
This is what c programmers actually believe

Name: Anonymous 2009-11-18 7:04

>>35
You are a retard. This linker flag prevents packages from breaking every other library update by linking only to libraries that are actually used. Especially useful in large programs that use shit like pkgconfig at compile time, which usually brings in twice the libraries the program normally needs.

Name: Anonymous 2009-11-18 7:21

>>37
-Werror is counter-intuitive to programming, because neither of these sentences is true:
- warnings always correspond to actual errors in ones source
- source for which no warnings are issued is correct

Name: Anonymous 2009-11-18 7:27

>>43
IHBT.

Name: Anonymous 2009-11-18 7:39

>>43
Why?

Name: Anonymous 2009-11-18 8:02

>>43
Uhh, the compiler authors are giving errors found during the compilation process. I fail to see how that's counter-intuitive.

Name: Anonymous 2009-11-18 16:08

>>46
I remember gcc used to BAWWW about this:

while(a=*i++)

Some sort of "suggest parentheses around = used in boolean expression" warning. But the code is perfectly fine, there is no error there.

Name: Anonymous 2009-11-18 16:21

>>47
That would be -Wall, not -Werror, and it would generate a warning, not an error. It would still compile just fine.

Name: Anonymous 2009-11-18 17:54

>>48
not -Werror
would generate a warning, not an error
IHBT 8/10

Name: Anonymous 2009-11-18 22:12

>>27
What, you don't like abusing cats?

Name: Anonymous 2009-11-18 22:40

>>47,48
Some sort of "suggest parentheses around = used in boolean expression" warning.
suggest parentheses around = used in boolean expression
parentheses around =
Did you try actually following the instructions?

while ((a=*i++))

This is a very good warning; the extra parentheses are sortof ugly, but the tradeoff is helping you catch = instead of == 100% of the time. You get used to them and it helps readability afterwards. Actually it's frustrating that Apple doesn't ever build -Wall, because all Objective-C documentation code, templates, etc. suggests a shitload of these, like this idiom in every fucking class:

- (id)init {
  if (self = [super init]) {
    // some shit
  }
  return self;
}


with the obvious warning around the assignment again. Go ahead, create a project template in Xcode, turn on -Wall, and enjoy the warnings. I fucking hate Objective-C.

Name: Anonymous 2009-11-19 2:33

>>51
Maybe if you had better eyes and/or font you could tell the difference between = and ==. I've written over 9000 lines (seriously) of C and have yet to make that mistake.

Name: Anonymous 2009-11-19 3:03

>>52
Yeah, I call bullshit on that. Everyone has made this mistake repeatedly, especially when learning a new language. Maybe you think haven't made it because it typically manifests in obvious ways, so you find the error, correct it quickly, and just forget about it; but you've absolutely made it.

I've written over 9000 lines (seriously)
You sound like MDickie. You're anon, what do you have to brag about? Any career programmer easily writes this many lines in a few months/years time.

Name: Anonymous 2009-11-19 3:23

>>52
wow over 9000 u must be an expert!! i can't someone has written so much

Name: Anonymous 2009-11-19 3:46

>>52
i've written over 9000 lines just while learning C by working through K&R.

Name: Anonymous 2011-02-04 20:00

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List