Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7726265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:10:14+00:00 2026-06-01T05:10:14+00:00

Consider the following source file, which is (at least should be) valid C. void

  • 0

Consider the following source file, which is (at least should be) valid C.

void id() {
}

I am trying to compile it with gcc -c test.m, but I get the following error:

test.m:1: error: ‘id’ redeclared as different kind of symbol
<built-in>:0: error: previous declaration of ‘id’ was here 

If Obj-C were a strict superset, wouldn’t it mean that all valid C programs also valid Obj-C programs? Note that I am not #importing anything, nor am I linking.

Granted, maybe LLVM(1) is doing something magical by default, or maybe this is a bug in it.

(1): i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)

EDIT: Let me clarify this question – the question is not about the id part, I know it has special meaning. My point is that it is commonly said that Obj-C is a strict superset of C. However, this can’t be the case if it has keywords that conflict with valid C programs.

So either id is not reserved by the compiler, or Obj-C is not a strict superset. The point of this question is to ask which is the case, or is there something obvious I am missing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:10:15+00:00Added an answer on June 1, 2026 at 5:10 am

    Superset means it adds some extra features too. Like id in this case. It is a defined type in Objective C. And these extra features of the superset always supersede the subset.

    Its just customary that people use the term strict superset. You need to take it with a pinch of salt!

    See these old posts in SO for a similar discussion

    Is objective C 2.0 a proper superset of C?

    Which dialect of C is Objective-C a "strict superset" of?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following data source: declare @Test table (EmpId int, ProdId int, Sold int)
Consider the following test case: #define _GNU_SOURCE #include <stdio.h> #include <stdarg.h> void test(char **outa,
Consider the following Java source: if( agents != null ) { for( Iterator iter
Please consider the following java source: package com.stackoverflow; public class CondSpeed { private static
Consider the following extension method in c#, Traverse: IEnumerable<T> Traverse<T>( this IEnumerable<T> source, Func<T,
Consider following example : public class SomeBusinessLayerService : DataService<MyEntityContainer> { [WebInvoke] void DoSomething(string someParam)
Consider following class class test { public: test(int x){ cout<< test \n; } };
Consider following program: static void Main (string[] args) { int i; uint ui; i
Consider the following source code. I have two classes CBar and CFoo. CFoo inherits
Consider the following directory structure: ./source/com/mypackage/../A.java ./extensions/extension1/source/com/mypackage/../T.java ./extensions/extension2/source/com/mypackage/../U.java ... ./extensions/extensionN/source/com/mypackage/../Z.java I want to produce

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.