I wouldn't be concerned said tools for ruleset development. (but would
otherwise recommend valgrind)

G++ flags/warnings
I always use: -ansi -pedantic -Wall
that's: ansi standards, pedantically strict, all warnings.
I also like: -Wextra -Woverloaded-virtual -Wold-style-cast
that's: extra warnings, overloading virtual functions (-not-
overriding), and those ugly c-style casts ;)

Hmm, and for more performance conscious code I'll throw in:
-Winline -Wpadded / warn if compiler can't/won't inline, and if it
pads the object size

-Tyler


On Sun, Jun 15, 2008 at 9:16 AM, Ryan Neufeld <[EMAIL PROTECTED]> wrote:
> Being new to "actual" development I have not heard or used of many of
> the tools you've mentioned. I'll make a point this week of looking
> into them and seeing what I can use to make my development better.
>
> As for warnings, I generally make a point of not having any. In the
> case of my Message not being initialized it turns out g++ didn't give
> me a warning. Forgive my naivety, but what flags can I set to increase/
> show warnings that don't normally get shown. (FYI - I do see warnings
> for things like unused variables, etc.)
>
> Thanks for both the help and the advice everyone.
>
> Ryan 'jphr' Neufeld
> ---------------------------
> visit me at hammerofcode.com
>
> On 14-Jun-08, at 9:20 PM, Brett Nash wrote:
>
>>>>    //Origin message setup
>>>>    Message* originMessage;          //message for origin
>>>>    assert(originMessage);
>>> Not surprising, really. Where's originMessage actually allocated? I'd
>>> also double-check your assert function (macro?), since I don't think
>>> it's working either (otherwise would have asserted there).
>>>
>>> BTW, when it comes to pointers, it is a really, really, really good
>>> idea to either new/malloc them straight away, or assign them to 0 to
>>> force a null-pointer (not sure all compilers assign variables 0 by
>>> default).
>>
>> Personally I think better advice is to READ THE COMPILER WARNINGS.  If
>> your compiler isn't printing warnings for uninitialised variables,
>> either change the flags, or get a new compiler.  Report spurious
>> warnings as bugs &/or fix them.  Your editor/IDE should take you to
>> warnings straight away so you have to look at the warnings.  If not,
>> change IDE/editor to one that does (vim or emacs).  I recommend use
>> -Werror for a while, to get in the habit of really culling warnings
>> down.  Aim for 0 warnings in all your code.
>>
>> Use tools such as lint or sparse to find bugs before they bite you:
>> (http://www.kernel.org/pub/software/devel/sparse/).  Use valgrind &
>> memprof to find memory problems early in development.
>>
>> As an aside, except static variables (initialised to a bit pattern of
>> all 0's - Not necessarily NULL for pointers), and array & structures
>> in
>> certain cases, variables in C & C++ are all uinitialised.
>>
>>       Regards,
>>       nash
>> _______________________________________________
>> tp-devel mailing list
>> [email protected]
>> http://www.thousandparsec.net/tp/mailman.php/listinfo/tp-devel
>
> _______________________________________________
> tp-devel mailing list
> [email protected]
> http://www.thousandparsec.net/tp/mailman.php/listinfo/tp-devel
>
_______________________________________________
tp-devel mailing list
[email protected]
http://www.thousandparsec.net/tp/mailman.php/listinfo/tp-devel

Reply via email to