Peter Lupton NCH Swift Sound wrote:
> But I have been going through other reports from the 'bug book' which I ask
> my programmers to log. Another case which explicit bools would solve would
> be (in Win32)...
>
> HANDLE hFile = CreateFile(...);
> if (!hFile) return;
>
> If t
On Tuesday 04 October 2005 15:39, Peter Lupton NCH Swift Sound wrote:
> Richard: based on your argument all type checking is for nought :).
>
> But I have been going through other reports from the 'bug book' which I ask
> my programmers to log. Another case which explicit bools would solve would
>
Richard: based on your argument all type checking is for nought :).
But I have been going through other reports from the 'bug book' which I ask
my programmers to log. Another case which explicit bools would solve would
be (in Win32)...
HANDLE hFile = CreateFile(...);
if (!hF
On 10/4/05, Peter Lupton NCH Swift Sound <[EMAIL PROTECTED]> wrote:
> Maybe I gave a too simple example on my first post. Another example common
> error which would be prevented by blocking implicit bool conversion might be:
>
> if (strcmp(szMyName, "Peter")) printf("Hello Peter");
>
> This ba
Maybe I gave a too simple example on my first post. Another example common
error which would be prevented by blocking implicit bool conversion might be:
if (strcmp(szMyName, "Peter")) printf("Hello Peter");
This bad error currently just slips through. If we gave an option to only
accept ex
On Oct 2, 2005, at 5:27 PM, Nicholas Nethercote wrote:
[~] g++ -Wall a.cpp
a.cpp: In function `int main()':
a.cpp:4: warning: suggest parentheses around assignment used as
truth value
And -Werror turns it into a hard error...
On Sat, 1 Oct 2005, [EMAIL PROTECTED] wrote:
C++ would be a better language if the boolean type did not implicitly
convert from int. For example, many novice programmers make the
mistake.
if (i = j) dosomething(); // Should be i == j
If conversion to boolean required explicit this would all
* Peter Lupton NCH Swift Sound <[EMAIL PROTECTED]> [051002 05:47]:
> I was hoping was that we could at least have a compile option. So we could
> turn it on if required. I would definitely mandate it in our organization
> at least. I am sure others would too.
I'd looked into getting some boolean
Hi Andrew,
I was hoping was that we could at least have a compile option. So we could
turn it on if required. I would definitely mandate it in our organization
at least. I am sure others would too.
We have a prepared list of common errors C++ novices make and the
accidental boolean is always
Andrew Pinski wrote:
But any thing else would just be a violation of the C and C++ standards.
I don't see that at all, optional switches/pragmas/directives that
subset the language are in no ways violation of the standards. THe
standard only requires that you have a mode in which the standard
>
> C++ would be a better language if the boolean type did not implicitly
> convert from int. For example, many novice programmers make the
> mistake.
>
>if (i = j) dosomething(); // Should be i == j
>
> If conversion to boolean required explicit this would all be solved. It
> would mean all
11 matches
Mail list logo