Re: compiler error
Date: Sun, 15 Feb 2004 01:11:29 +0000
In message <firstname.lastname@example.org>, Robert W Hand
>On Sat, 14 Feb 2004 21:54:47 +0000 (UTC), "Jason"
>>int a, b, c;
>>//place values in a,b,c using atoi
read his code, specifically the comment above.
>>x.func(a, b, c);
>>And the compiler says this:
>>no matching function for call to 'XClass::func(int&, int&, int&)
>>candidates are: int XClass::func(int, int, int);
>>What might have gone wrong?
>>Clearly I have declared a,b,c ok and not done much with them except set them
>>to certain values. Why would the compiler complain that I am calling the
>>function using references when I am not?
>It is undefined behavior.
He said he had omitted the initialisation code. Anyway even if he
actually left it out, the compiler would not do what he reports.
> Automatic variables that are not
>initialized have indeterminant values. You are not allowed to assign
>their values to other variables. But you can assign the objects a, b,
>c to references to int without specifying values for a, b, c. So it
>may be that your compiler has noted the undefined behavior and warned
>you about it.
>Perhaps someone will have a better idea.
Francis Glassborow ACCU
Author of 'You Can Do It!' see http://www.spellen.org/youcandoit
For project ideas and contributions: http://www.spellen.org/youcandoit/projects
- Re: compiler error
... Why would the compiler complain that I am calling the ... It is undefined behavior. ... Automatic variables that are not ... c to references to int without specifying values for a, b, c. So it ...
- Re: Help me identify a Cobol database
... I DO/Don't know COBOL ... As indicated M/F traditionally use xxxx.DAT to indicate the data file, but in this instance,, the developer chose to use the extension xxxx.DB. ... To complicate it even further,, the developer, in order to save disk space, may have used a compiler DIRECTIVE to compress data - basically repeating characters are indicated by a count. ... I don't know whether they are still active but if you google on 'COBOL FAQ',, it may have references to COBOL Developers who have produced Data conversions - primarily they were aiming at converting from COBOL-Vendor-A to COBOL-Vendor-B compilers. ...
- Re: Is this valid C statement?
... > Unless the type name specifies a void type, ... >any constraint), but it invokes undefined behavior, since the standard ... The ones the compiler can detect. ... They may diagnose them, but typically only if the user ...
- Need help figuring out: "CVT1100 Duplicate Resource: type ICON"
... I tried changing the value of typelib resource ID - I tried a whole ... Since the MSDN groups couldn't offer any enlightenment other than to say ... I commented out ALL references I got "CVT1100 duplicate resource type Dialog ... This program compiles using the 4.2 compiler - there is still a version ...
- Re: whats wrong with atof() and casting?
... The return type of the function was int, ... Since atofDOES NOT return an int, this is wrong and undefined behavior. ... Note that a compiler is not required to do anything at all when you ... There is no requirement in the C standard that they do. ...