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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:08:23+00:00 2026-06-17T19:08:23+00:00

I am using gcc to compile some C++ code, and while the code compiles

  • 0

I am using gcc to compile some C++ code, and while the code compiles fine when using “Debug” configuration, it emits warnings in “Release” configuration. The only difference in the compile options is:

“Debug”: g++ -O0 -g3 ...

“Release”: g++ -O3 ...

The message I see in the “Release” build:

../src/xml.cpp: In static member function ‘static Z<char>* XML::ReadToZ(const char*, XMLTransform*, XMLTransformData*)’:
../src/xml.cpp:5034: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result
../src/xml.cpp:5041: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result

The relevant two statements are:

/* 5034 */ fread((*y).operator char *(),1,S,fp);
/* 5041 */ fread(yy.operator char *(),1,S,fp);

Why is there a difference in warnings?

  • 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-17T19:08:24+00:00Added an answer on June 17, 2026 at 7:08 pm

    There’s a bug report at the GCC bugzilla about this behaviour. Try adding –no-warn-unused-result to your “Release” profile.

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

Sidebar

Related Questions

I am using gcc on linux to compile C++ code. There are some exceptions
I need to compile some code of mine using the gcc compiler included in
While trying to compile a 64 bit linux kernel using gcc, I see the
I am trying to compile my gcc code using the following make command .
I've installed GCC 3.4 to /opt/gcc-3.4, and I'm using it to compile legacy code
I'm having a bit of an odd problem while trying to compile some code
I am using gcc/g++ to compile c/c++ applications - living on OpenSuSe btw. Is
When I try to compile my program on ubuntu using gcc, i get these
I use GNUStep to compile Objective-C on Windows 7 using GCC and MinGW. I'd
I am attempting to compile a c++ class using gcc. Due to the nature

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.