Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.physics > #829402 > unrolled thread

ChrisV, try this !

Started byJeff-Relf.Me @.
First post2021-08-01 19:41 -0700
Last post2021-08-02 07:34 -0500
Articles 5 — 3 participants

Back to article view | Back to sci.physics


Contents

  ChrisV, try this ! Jeff-Relf.Me  @. - 2021-08-01 19:41 -0700
    Re: ChrisV, try this ! rbowman <bowman@montana.com> - 2021-08-01 21:30 -0600
      Level 4 warnings only stop brain-farts, typos. Jeff-Relf.Me  @. - 2021-08-01 21:07 -0700
      Re: ChrisV, try this ! chrisv <chrisv@nospam.invalid> - 2021-08-03 10:02 -0500
    Re: ChrisV, try this ! chrisv <chrisv@nospam.invalid> - 2021-08-02 07:34 -0500

#829402 — ChrisV, try this !

FromJeff-Relf.Me @.
Date2021-08-01 19:41 -0700
SubjectChrisV, try this !
Message-ID<Jeff-Relf.Me@Aug.1--7.41pm.Seattle.2021>
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

[toc] | [next] | [standalone]


#829407

Fromrbowman <bowman@montana.com>
Date2021-08-01 21:30 -0600
Message-ID<imp76mFhq17U1@mid.individual.net>
In reply to#829402
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 &&.

[toc] | [prev] | [next] | [standalone]


#829411 — Level 4 warnings only stop brain-farts, typos.

FromJeff-Relf.Me @.
Date2021-08-01 21:07 -0700
SubjectLevel 4 warnings only stop brain-farts, typos.
Message-ID<Jeff-Relf.Me@Aug.1--9.07pm.Seattle.2021>
In reply to#829407
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.

[toc] | [prev] | [next] | [standalone]


#829512

Fromchrisv <chrisv@nospam.invalid>
Date2021-08-03 10:02 -0500
Message-ID<illiggdb0l69u36aig7pk85odjt0kp7skl@4ax.com>
In reply to#829407
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

[toc] | [prev] | [next] | [standalone]


#829438

Fromchrisv <chrisv@nospam.invalid>
Date2021-08-02 07:34 -0500
Message-ID<79pfggpugi9bfesk400v2kdatqc3ej2mu3@4ax.com>
In reply to#829402
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

[toc] | [prev] | [standalone]


Back to top | Article view | sci.physics


csiph-web