473,405 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Re: Warn about unspecified behaviour

Tomás Ó hÉilidhe wrote:
Is there any sort of tool out there that can warn about code that can
behave differently depending on "unspecified" behaviour? For instance,
take the following statement:

*p++ = ConvertToLowercase(*p);
<digression>

That's not just unspecified, it's undefined: It both modifies `p'
and reads it (for a purpose other than computing the new value),
without a sequence point between the two accesses.

There's a sequence point between the evaluation of `*p' and the
invocation of ConvertToLowercase(), and there's another sequence
point just before the function returns (if the function is written
in C), but that doesn't mean that there's a sequence point between
the two uses of `p'.

</digression>
[...]
Is there any sort of tool that can go through code and warn about
instances in which "unspecified" behaviour can result in two or more
different behaviours?
Your compilers may be able to diagnose some of them, if you crank
their diagnostic sensitivities high enough. There's also "lint," which
(like "cc") comes in a lot of flavors with varying capabilities, in
both commercial and non-commercial versions. I don't know which lints
will and won't catch this sort of thing, but that's the place to start
your search.

--
Er*********@sun.com
Jul 23 '08 #1
0 1471

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrew | last post by:
After using VS.Net without trouble for some time, I am now unable to create a new project or add a component to an existing project. Existing code compiles and runs OK. The problem started after...
25
by: Nitin Bhardwaj | last post by:
Well, i'm a relatively new into C( strictly speaking : well i'm a student and have been doing & studying C programming for the last 4 years).....and also a regular reader of "comp.lang.c" I...
0
by: Andrew | last post by:
After using VS.Net without trouble for some time, I am now unable to create a new project or add a component to an existing project. Existing code compiles and runs OK. The problem started after...
0
by: CBFalconer | last post by:
Tomás Ó hÉilidhe wrote: And neither may occur. The standard clearly states that the results are undefined. If you write foolish code like that you expect random crashes. Some tools will...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.