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 7805273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:10:24+00:00 2026-06-02T02:10:24+00:00

Suppose a long time ago, I had created the following enumeration: typedef enum {

  • 0

Suppose a long time ago, I had created the following enumeration:

typedef enum
{
   GeometricPoint,
   GeometricLine,
   GeometricSquare,
   GeometricRectangle,
   GeometricCircle
}GeometricFigures;

I introduced those a while ago within my awesome engine and now I have finally decided that people should not use GeometricSquare anymore as that is covered by GeometricRectangle already.

For a start, I would possibly change my enumeration towards something like this:

typedef enum
{
   GeometricPoint,
   GeometricLine,
   GeometricRectangle,
   GeometricSquare = GeometricRectangle,
   GeometricCircle
}GeometricFigures;

That would certainly keep my awesome engine backwards compatible but on the other hand increase the legacy junk. Hence I would like to remove GeometricSquare altogether in a foreseeable future. To make that obvious to the users of my engine, I would like to mark GeometricSquare as being deprecated.

My goal is that the documentation (doxygen) as well as the code completion (Xcode) and last but not least the compiler (GCC) will make it obvious to the user that GeometricSquare should not be used anymore and has been replaced by GeometricRectangle.

For the documentation, I would simply use @deprecated keyword;

typedef enum
{
   GeometricPoint,
   GeometricLine,
   GeometricRectangle,
   ///@deprecated Has been replaced by GeometricRectangle
   GeometricSquare = GeometricRectangle,
   GeometricCircle
}GeometricFigures;

But how about Xcode and GCC?

Unfortunately, the usual GCC (method) attribute does not seem to do the job. Adding __attribute__((deprecated)) as drafted below causes a syntax error.

typedef enum
{
   GeometricPoint,
   GeometricLine,
   GeometricRectangle,
   GeometricSquare = GeometricRectangle __attribute__((deprecated)),

Parse Issue
Expected }

   GeometricCircle
}GeometricFigures;

So obviously that either does not work altogether or I am simply using it wrong.

  • 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-02T02:10:25+00:00Added an answer on June 2, 2026 at 2:10 am

    I think you’re attaching the __attribute__ bit to the wrong side of the assignment operator. This seems to work fine:

    typedef enum
    {
       GeometricPoint,
       GeometricLine,
       GeometricRectangle,
       GeometricSquare __attribute__((deprecated)) = GeometricRectangle,
       GeometricCircle
    }GeometricFigures;
    

    and now assigning GeometricSquare gives a compiler warning:

    int fig = GeometricSquare;    //'GeometricSquare' is deprecated
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For a long time I had the following bookmark in Firefox: http://www.codeguru.com/csharp/.net/net_general/keyboard/article.php/c4639 I know
A long time ago, I remember using some Solaris make, and they had an
I have a servlet which processes a request for a long time. It suppose
I have this doubt for a long time... hope anyone can enlight me. Suppose
I suppose this is a long shot considering how few Wonderware questions I've seen
Suppose I have a class like this: class Owner { private: long m_Id; QString
Suppose we have the following table data: ID parent stage submitted 1 1 1
Suppose I have the following HTML: <form id=myform> <input type='checkbox' name='foo[]'/> Check 1<br/> <input
Suppose my db looks like this: id | person_id | hobby | time -----------------------------------
Hi I suppose to write a program that show the run time complixity I

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.