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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:08:08+00:00 2026-05-27T16:08:08+00:00

I’m facing a weird problem. I looked around all over stackoverflow.com and elsewhere, but

  • 0

I’m facing a weird problem. I looked around all over stackoverflow.com and elsewhere, but I didn’t find an answer.

Here’s some background: I’m writing a simple library; mostly for educational purposes and to understand C++ better. I’m using a MacBook Pro with Snow Leopard. I have an installation of Xcode 4.2 as well, however I use only VIM to edit my code. I recently finished implementing the GNU build system for whatever I have so far, so that I do not have to depend on Xcode anymore, and at the same time not have to write and maintain custom Makefiles. I’m using highest levels of warnings. Here’re the flags I’ve got so far (but I keep adding on to them incrementally, understanding the reasons for each flag as I go): -Wall -Wmissing-field-initializers -Wno-trigraphs -Wreturn-type -Wnon-virtual-dtor -Woverloaded-virtual -Wmissing-braces -Wparentheses -Wswitch -Wunused-value -Wsign-compare -Waddress -Wsequence-point -Wshorten-64-to-32 -Wwrite-strings -Wold-style-cast, and finally, -Werror.

Now, I have a function which very simply returns a value:

wint_t weof() {
  return static_cast<wint_t>(WEOF);
}

However, when I compile this code, I get the warning “use of old-style cast”. I don’t understand how static_cast<> can be “old-style”. Could anybody explain to me why this is happening? I thought I’d find the answer by looking at the definition of WEOF, but on Mac it’s defined to __DARWIN_WEOF and I can’t seem to find the definition of that.

Thanks!

  • 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-05-27T16:08:09+00:00Added an answer on May 27, 2026 at 4:08 pm

    Most likely the __DARWIN_WEOF macro itself is using an old-style cast (doing some web searching, it seems the value is likely ((__darwin_wint_t)-1)). If you are using C-compatible headers, it’s unlikely you’ll be able to fully enable -Wold-style-cast.

    As a workaround, you could try surrounding any offending code with an appropriate #pragma to disable this warning.

    #pragma GCC diagnostic push
    #pragma GCC diagnostic ignored "-Wold-style-cast"
    // ... code goes here ...
    #pragma GCC diagnostic pop
    

    But this will probably get pretty tiresome/verbose after a while…

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

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.