mainGNUstep - Support: sr #103134, proper CFLAGS for handling objc...

Group
 
 

You are not allowed to post comments on this tracker with your current authentication level.

sr #103134: proper CFLAGS for handling objc code

Submitter:  None
Submitted:  Mon 14 Jun 2004 09:26:02 PM UTC
   
 
Category:  Foundation Priority:  5 - Normal
Severity:  2 - Minor Status:  Invalid
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Closed
Operating System:  None

Tue 02 Nov 2004 05:19:09 AM UTC, comment #3: 

No response in several months.

Adam Fedor <fedor>
Group administrator
Tue 15 Jun 2004 09:10:24 AM UTC, comment #2: 

The problem is that make as well uses extensions to determine how to build files. :-)  So files ending in .m will be built as Objective-C, while files ending in .c will be built a C files - regardless of where you list them, in C_FILES or OBJC_FILES.  C_FILES vs OBJC_FILES is just syntactic sugar. :-)

We could add '-x objective-c' when compiling ObjC - that is easy enough - in the rule used to compile the %.m files into %.o files, we add -x objective-c at the beginning.  Would that help though ?  It would only be used for %.m files, which the compiler should already know are ObjC files, so the point of adding -x objective-c is somewhat lost.

Could I have an example (ie, a GNUmakefile) of a case where the current rules don't work well and adding '-x objective-c' would help ?

I'd be happy to help figuring out what to do to fix those,
including adding -x objective-c if it really helps, at the moment I'm not particularly convinced it's worth adding it.

Thanks

Nicola Pero <nico>
Group Member
Tue 15 Jun 2004 07:56:39 AM UTC, comment #1: 

This seems like the compiler is confused somehow.  The fact that the file name has the ".m" suffix should suffice to select the the cc1obj compiler.  My first suspicion would be that your compiler doesn't have Objective-C configured, but then adding -x objective-c shouldn't help either.  Could you attach a log of 'make messages=yes'?

David Ayers <ayers>
Group Member
Mon 14 Jun 2004 09:26:02 PM UTC, original submission:  

Depending on the file extension is a bad idea and if someone were to intermingle extensions you could create havoc.  GCC doesn't even do a great job handling them either. 

gcc should always be flagged with '-x objective-c' for objc code.  This should not be an issue to implement since the makefiles are using things like this Gorm_OBJC_FILES.

If gcc does a bad job handling the file, you also see this error.

<dan2>  Compiling file IBInspector.m ...
<dan2> cc1: warning: "-fgnu-runtime" is valid for ObjC but not for C/C++
<dan2> cc1: warning: "-fconstant-string-class=" is valid for ObjC but not for C/C++


Anonymous

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-11-02 fedor StatusNone Invalid
    Open/ClosedOpen Closed

Back to the top

Powered by Savane 3.13-758e.
Corresponding source code