helpAdun - Support: sr #1838, compilation messages

 
 
Show feedback again

sr #1838: compilation messages

Submitted by:  None
Submitted on:  Thu 13 Dec 2007 07:08:39 PM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 3 - NormalStatus: Done
Privacy: PublicAssigned to: None
Originator Email: -unavailable-Open/Closed: Open
Operating System: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 13 Dec 2007 08:01:46 PM UTC, comment #1:

None of these are serious - Ill explain them anyway.

The first is because setNonbondedPairs: is a private method of AdDataSource (not declared in its interface). Its actually unstable and going to change sometime. I didn't hide it like other private methods so this warning would remind about this.

The next two are because these methods are defined by the AdForceField subclass AdMolecularMechanicsForceField.
They are not defined in the AdForceField because its possible it wont have 'coreTerms' e.g. a QM force field.
However I defined AdSimulationData to work on generic force field objects (because it should) - hence again this error is to remind me this still has to be looked at.
It doesn't matter at the moment since all force field objects respond to these methods. Its more for future reference.

The last is a common occurrence under certain versions of gcc.
Since Objective-C is completely dynamic when you call a method in your code its destination isn't decided until runtime.
However you can turn on warnings to basically say
1) No method with that name can be found in any interface (the first warning is this type)
2) Multiple methods with the same name were found and the compiler doesn't know which it will be at runtime.
This happens when you use id as a type. In this case the compiler doesn't know if this is setNonbonded pairs in AdDataSource or AdNonbondedTerm.
But this doesn't matter since it all will be decided at runtime anyway.

This last situation happens very frequently in objective c since its dynamism is its advantage and people frequently use id.
In newer versions of gcc (4+) this warning is no longer a default - hence why you see it on MN (3.3 i think) but not on your workstation.

Of the other errors you might see 'method definition not found' indicates a method was declared in an interface but no matching implementation was found.
Very common since it reminds you of which classes haven't been finished.

The most serious one I can think of is 'assignment from distinct Objective-C type'
i.e. you're trying to assign one type to another.
This usually indicates a programmatic error but due to 2 above it can be the result of the compiler picking the wrong method.

Michael Johnston <mjohnston>
Project Administrator
Thu 13 Dec 2007 07:08:39 PM UTC, original submission:

Thanks for the makefile for MN, Michael...

I have a few compilation messages that I'm a bit concerned about (now that I understand Obj-C better and run into some of these in my own code).

In workstation I see (these seem the most grave):

AdunDataSource.m:239: warning: `AdDataSource' does not respond to `setNonbondedPairs:'

AdunSimulationData.m:506: warning: ‘AdForceField’ may not respond to ‘-coreTerms’

AdunSimulationData.m:950: warning: ‘AdForceField’ may not respond to ‘-arrayOfCoreTermEnergies’

In MN in addition to those I see:

AdunMultithreadedNonbondedTerm.m:239: warning: multiple declarations for method `setNonbondedPairs:'
../Headers/AdunKernel/AdunNonbondedTerm.h:124: warning: using `-(void)setNonbondedPairs:(NSArray *)nonbondedPairs'

(and others like that in that same class)

Are these things that I should worry about? This last ones doesn't seem to be currently used...

Anonymous

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rulix (Updated the item)
  • -unavailable- added by mjohnston (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 17 Dec 2007 06:22:25 PM UTCrulixStatusWorks For Me=>Done
    Mon 17 Dec 2007 06:21:56 PM UTCrulixStatusNone=>Works For Me
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup