Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ChrisV, try this !

3 views
Skip to first unread message

Jeff-Relf.Me

unread,
Aug 1, 2021, 10:41:24 PM8/1/21
to
Try this, ChrisV !
Use " warnings as errors " and turn off these "level 4" warnings:

c4100: unreferenced parameter. Useful when debugging.
c4101: unreferenced local variable. OK when debugging.
c4127 conditional expression is constant.

while(1) is OK.
"if ( ComplexExpression, 1 )" is a good debugging technique.

c4189: local variable is initialized but not referenced.

Variables get commented out, at times, when debugging.
With " warnings as errors ", you don't want it to stop the debuging.
UnUsed variables are informative, and might be needed again, later.

c4238 nonstandard extension used: class rvalue used as lvalue.

Needed when a simple int is (randomly) defined as an overly
convoluted/Byzantine class ( like ID2D1SolidColorBrush ).

c4239 type conversion; C++ randomness.
c4244 '=': conversion from 'int' to 'char', possible loss of data.
c4302 conversion from a larger type to a smaller type.

c4305 truncation from 'double' to 'float'.
C4309 '=': truncation of constant value.
c4310 cast truncates constant value.

c4311 64-bit pointer truncation ( storing shorts in a pointer ).

Implicit casting is cleaner/nicer.

c4312 conversion from a smaller type to a larger type.
c4430 missing type specifier - int assumed; more C++ randomness.

c4456 declaration of 'P' hides previous local declaration.
c4457 declaration of 'P' hides function parameter.
c4458 declaration of 'a' hides class member.

<D2D1helper.H> needs it, more randomness.

c4459 declaration of 'P' hides global declaration.

P ( a ShortTerm, local pointer ) is cleaner/nicer.

c4474 'swprintf' : too many arguments passed for format string.

A format string, passed to a macro,
might have default (unused) arguments.

c4508 'Func': function should return a value; 'void' assumed.

"Func() {}" is cleaner/nicer than "void Func() {}".

c4554 check operator precedence for possible error.

Fewer parenthesis is cleaner/nicer; just know the precedence.
Use: b = 1, b -= Hr - (int)Hr, b = min( HrsOffLn, b )
Not: b = min( HrsOffLn, ( 1 - ( b - ( Hr - (int)Hr ) ) ) )

c4702: UnReachable code.

A tempory "return" is needed, at times, when debugging.
With " warnings as errors ", you don't want it to stop the debuging.

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 ]".

c4838 conversion from 'int' to 'wchar' requires a narrowing conversion
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

rbowman

unread,
Aug 1, 2021, 11:30:35 PM8/1/21
to
On 08/01/2021 08:41 PM, Jeff-Relf.Me@. wrote:
> c4127 conditional expression is constant.

That might have helped with the recent Akamai fail. Reports were it was
a result of & instead of &&.


Jeff-Relf.Me

unread,
Aug 2, 2021, 12:07:35 AM8/2/21
to
You (Bowman) replied ( to me ):
> > c4127 conditional expression is constant.
> >
> > while(1) is OK.
> > "if ( ComplexExpression, 1 )" is a good debugging technique.
>
> That might have helped with the recent Akamai fail.
> Reports were it was a result of & instead of &&.

Using "&" when it should've been "&&" is unrelated
to the c4127, "Level 4", "while(1)" warning.

Level 4 warnings only stop brain-farts, typos.

They won't help you fix deeper bugs.

chrisv

unread,
Aug 2, 2021, 8:34:50 AM8/2/21
to
Jeff-Relf.Me @. wrote:

>Try this, ChrisV !
>Use " warnings as errors " and turn off these "level 4" warnings:

Hey man, I understand that that people often get-away with ignoring
design guidelines and safety margins. I said as much, regarding this
issue, a long time ago.

--
'[chrisv is] the same dimwit who thinks that determining if software
works or not is accomplished through "compile time warnings" and not
by actually testing the software.' - trolling fsckwit "Ezekiel",
lying shamelessly

chrisv

unread,
Aug 3, 2021, 11:03:00 AM8/3/21
to
rbowman wrote:

> Jeff-Relf.Me@. wrote:
>>
>> c4127 conditional expression is constant.
>
>That might have helped with the recent Akamai fail. Reports were it was
>a result of & instead of &&.

Well who would have guessed that mistakes can be made that the
compiler will not warn you about?? Doesn't the compiler know what
you're trying to accomplish??? /S

We've actually had losers, in here, so *desperate* to attack their
superior, so *shameless* in their assholery, that they claimed that I
didn't know that computer programs need to be tested to make sure that
they function correctly.

You would certainly never see a decent person go on the attack with
such a *ridiculous* claim...

--
"ALL non-idiots support the use of testing over compile-time warnings
to determine if the code functions correctly. [chrisv is] one of the
few idiots who thinks otherwise." - DumFSck, lying shamelessly
0 new messages