Thread View: news.software.readers
1 messages
1 total messages
Started by Jeff-Relf.Me
Mon, 27 Mar 2017 18:10
Peter Kohlmann _personally edited, compiled and debugged a .C file ?
Author: Jeff-Relf.Me
Date: Mon, 27 Mar 2017 18:10
Date: Mon, 27 Mar 2017 18:10
82 lines
4240 bytes
4240 bytes
Peter Köhlmann replied ( to my comment ):
> > > Jeff Relf: " Testing is how you know if the code works or not,
> > > not compile-time warnings. "
> >
> > Relf's claim is maximum stupid.
> > Someone like Relf should not be allowed anywhere near a compiler.
I edited, compiled and debugged X.CPP yesterday,
in order to test the speed and accuracy of various "pay" servers.
When was the last time Peter Köhlmann _personally
( hiring a plumber doesn't make you a plumber )
edited, compiled and debugged a .C file ?
With "warnings as errors", turn off these warnings:
c4702: UnReachable code.
A tempory "return" is needed, at times, when debugging.
c4100: unreferenced parameter.
c4101: unreferenced local variable.
c4189: local variable is initialized but not referenced.
Variables gets commented out, at times, when debugging.
UnUsed code is informative, and might be needed again.
c4430 missing type specifier - int assumed; No C++ support.
c4508 'Func': function should return a value; 'void' assumed.
"Func() {}" is cleaner/nicer than "void Func() {}".
c4456 declaration of 'P' hides previous local declaration.
c4457 declaration of 'P' hides function parameter.
c4459 declaration of 'P' hides global declaration.
P ( a ShortTerm, local pointer ) is cleaner/nicer.
c4996 'sprintf': This function may be unsafe.
Str( Err, L"0x%x", Enum ) is cleaner/nicer than
swprintf_s( Err, 22, L"0x%x", Enum ).
Global: #define Str swprintf
c4239 type conversion; No C++ support.
c4312 conversion from a smaller type to a larger type.
c4305 truncation from 'double' to 'float'.
c4302 conversion from a larger type to a smaller type.
c4244 '=': conversion from 'int' to 'char', possible loss of data.
c4838 conversion from 'int' to 'wchar' requires a narrowing conversion
c4311 64-bit pointer truncation ( storing shorts in a pointer ).
Implicit casting is cleaner/nicer.
c4127 conditional expression is constant.
while(1) is OK.
"if ( ComplexExpression, 1 )" is a good debugging technique.
c4706 assignment within conditional expression.
c4709 comma operator within array index expression.
Often, it's cleaner/nicer to assign stuff in an expression;
same for array indices, "R_[ i++, i %= 4 ]".
c4554 check operator precedence for possible error ( Level 3 ? ! )
Fewer parenthesis is cleaner/nicer; just know the precedence.
c4474 'swprintf' : too many arguments passed for format string.
A format string, passed to a macro,
might have default (unused) arguments.
c4458 declaration of 'a' hides class member.
<D2D1helper.H> needs it, don't know why.
c4238 nonstandard extension used: class rvalue used as lvalue.
Needed when a simple int is (foolishly) defined as an overly
convoluted/Byzantine class ( like ID2D1SolidColorBrush ).
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads