|
Bugzilla – Full Text Bug Listing |
| Summary: | xosview-1.8.2-5: undefined C code | ||
|---|---|---|---|
| Product: | [openSUSE] SUSE LINUX 10.0 | Reporter: | David Binderman <dcb314> |
| Component: | Basesystem | Assignee: | Dr. Werner Fink <werner> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Minor | ||
| Priority: | P5 - None | ||
| Version: | Final | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | SuSE Linux 10.0 | ||
| Whiteboard: | |||
| Found By: | Other | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
Please explain the difference between
*p = tolower(*p); ++p;
and
*p++ = tolower(*p);
... IMO the `++' is only applied after the value
of the current p is changed. And AFAIK the left
side of the asignment is executed before.
>Please explain the difference between
This is a FAQ for C, but I'll have a go anyway
There are no guarantees in C that the left side of
an assignment is evaluated before or after the right side.
The ++ of p on the left side could happen at any time after
the value of p is read for the left side.
This is independent of the read of p on the right side.
More detail is provided in K&R C [ the white book ] or
Steve Summit's FAQ for C.
Even more detail is provided by doing a web search for
"sequence points" in ISO C standards documents and the like.
I am happy to answer any further questions.
Fixed for next release |
I just tried to compile package xosview-1.8.2-5 with a prerelease of the GNU C compiler version 4.1. It said Xrm.cc:101: warning: operation on "p" may be undefined The source code is while (p && *p) *p++ = tolower(*p); I agree with the compiler - this code seems to be undefined. Suggest new code while (p && *p) { *p = tolower(*p); ++p; } BTW, the email address of the author seems to be broken [ romberg@md.fsl.noaa.gov ]