Bug 79230
Summary: | bad source code | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | d.binderman |
Component: | ncurses4 | Assignee: | Eido Inoue <havill> |
Status: | CLOSED UPSTREAM | QA Contact: | |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 8.0 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2004-04-19 19:36:41 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
d.binderman
2002-12-08 10:30:32 UTC
The code is technically legal and correct C and use of side effects-- although it's style would be questioned. The warnings do not occur with the default flag settings in the Makefile (nor is it compiled and packaged), and the code is demo/test code which won't be used in the actual library, so I'm going to leave it as-is. >The code is technically legal and correct C and use of side effects-- >although it's style would be questioned. The compiler doesn't think so. It's a fine point, which I am willing to let slip, but usually a compiler has a much better idea of the language standard than most developers. >The warnings do not occur with the default flag settings in the >Makefile Good point. >the code is demo/test >code which won't be used in the actual library, so I'm going to leave >it as-is. Seems ok to me. >>The code is technically legal and correct C and use of side effects-- >>although it's style would be questioned. >The compiler doesn't think so. Sure it does. That's why it's a "warning" and not an "error". It's a warning because the type of code used requires an intimate knowledge of order-of-evaluation with C-- which programmers (because they know many languages with different order-of-evaluations and often get them mixed up or forget). The compiler is giving a "warning" because it's legal C but is statistically highly likely to be a bug and/or have unintended consequences during run-time.
>Sure it does. That's why it's a "warning" and not an "error".
Not quite. C and C++ are permissive programming languages.
Given any old rubbish, they just shut up & try to compile it,
i.e. they always try to trust the programmer.
This is rule 1 for any C or C++ compiler.
Only by turning up the warning levels can you get most
C compilers to complain about rubbish code.
I've done that, it's complained about rubbish code.
The rest is up to you.
|