• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Thanks: Newbie: No Problems, Program compiles and works, but it has warnings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thanks: Newbie: No Problems, Program compiles and works, but it has warnings


  • Subject: Re: Thanks: Newbie: No Problems, Program compiles and works, but it has warnings
  • From: George Greene <email@hidden>
  • Date: Thu, 6 Nov 2003 21:28:14 -0500

Thanks, I added:

NSString *ltob(unsigned long val);

to the Controller.h file. It worked. All warnings are gone.

Question: When do you put - (minus) in front of function header?

I entered:

- NSString *ltob(unsigned long val);

and got a lot of errors.

The - is only used for functions for classes?

/
************************************************************************
********************/

On Thursday, November 6, 2003, at 08:42 PM, James Spencer wrote:

> In Controller.m double check the declaration of the ltob method (which
> I assume is on line 91) to make sure that the return type and the
> parameter declaration is EXACTLY what you have in the header file. ou
> might want to turn on the debugger, put a break point on the first
> line of the member and see if your program is really calling ltob.
> My guess is that you have it misdeclared in the header but correct in
> the implementation file and, if so, this explains why your program
> works right despite the warnings.
>
> Personally I've found that even if the program appears to work
> correctly, you should ALWAYS get rid of warnings because, especially
> as a beginner, they are rarely innocuous.
>
> Spence
>
> James P. Spencer
> Rochester, MN
>
> email@hidden
>
> "Badges?? We don't need no stinkin badges!"
> On Nov 6, 2003, at 6:51 PM, George Greene wrote:
>
>> I'm using Mac OS X 10.2.8, Project Builder Version 2.1 Component
>> versions
>> PB IDE:114.0 PB Core: 1120 ToolSupport:110.
>>
>> The settings for Project Builder are the defaults, I changed nothing
>> when I first started the program.
>>
>> In following the book, "Building Cocoa Application Step by Step",
>> Chapter 7, Delegation and Resizing, page 220, page 221, I get the
>> following warnings.
>>
>> warning: implicit declaration function 'ltob'
>> warning: assignment makes pointer from integer without a cast
>> warning: type mismatch with previous implicit declaration
>> warning: previous implicit declaration of 'lbod'
>> warning: 'ltob' was previously implicitly declared to return 'int'
>> Build succeeded (5 warnings)
>>
>>
>> /usr/bin/gcc3 -c -F/Users/gmg/Calculator/build
>> -I/Users/gmg/Calculator/build/include -arch ppc -fno-common
>> -fpascal-strings -O0 -Wmost -Wno-four-char-constants
>> -Wno-unknown-pragmas -pipe "-fmessage-length=0" -mdynamic-no-pic -g
>> -Wp,-header-mapfile,/Users/gmg/Calculator/build/Calculator.build/
>> Calculator.build/Calculator.hmap --load-pch
>> /Users/gmg/Calculator/build/Calculator.build/Calculator.build/
>> PrefixHeaders/Calculator_Prefix-ppc.pfe Controller.m -o
>> /Users/gmg/Calculator/build/Calculator.build/Calculator.build/Objects-
>> normal/ppc/Controller.o
>> Controller.m: In function `-[Controller displayX]':
>> Controller.m:91: warning: implicit declaration of function `ltob'
>> Controller.m:91: warning: assignment makes pointer from integer
>> without
>> a cast
>> Controller.m: At top level:
>> Controller.m:124: warning: type mismatch with previous implicit
>> declaration
>> Controller.m:91: warning: previous implicit declaration of `ltob'
>> Controller.m:124: warning: `ltob' was previously implicitly declared
>> to
>> return `int'
>>
>> The program runs fine, as far as I can tell.
>>
>> I'm curious, how would I correct the program so that no warnings show
>> up.
>>
>> Thanks,
>>
>> george.
>> _______________________________________________
>> cocoa-dev mailing list | email@hidden
>> Help/Unsubscribe/Archives:
>> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>> Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Thanks: Newbie: No Problems, Program compiles and works, but it has warnings
      • From: Laurent Daudelin <email@hidden>
  • Prev by Date: Re: Newbie: No Problems, Program compiles and works, but it has warnings
  • Next by Date: Newbie: another warning after adding Delegate Method to the Controller
  • Previous by thread: Subject: Re: XCode problem: debugger doesn't stop on breakpoint
  • Next by thread: Re: Thanks: Newbie: No Problems, Program compiles and works, but it has warnings
  • Index(es):
    • Date
    • Thread