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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:13:17+00:00 2026-06-17T14:13:17+00:00

When I am trying to compile a particular program with -Wall , GCC is

  • 0

When I am trying to compile a particular program with -Wall, GCC is showing the warning as:

expcal.c:66:5: warning: statement with no effect [-Wunused-value]

this warning is referring the line:

ed.operator[j] == str[i];

which is found in the following loop:

for(i=0;i<strlen(str);i++)
        {
                j=0;
                if(str[i] == '+' || str[i] == '-' || str[i] == '*')
                {
                        if(str[i+1] == '+' || str[i+1] == '-' || str[i+1] == '*')
                                return 0;
                        else
                        {
                                //j=0;
                                ed.operator[j] == str[i];
                                count++;
                                j++;
                        }
                }
        }

I know that this warning will arise when there’s something wrong with an assignment statement. What is wrong in the above code that would cause GCC to generate such a warning?

  • 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-17T14:13:18+00:00Added an answer on June 17, 2026 at 2:13 pm

    The statement

    ed.operator[j] == str[i];
    

    isn’t an assignment; it’s a comparison using ==. To make this an assignment, try writing

    ed.operator[j] = str[i];
    

    The warning that you’re getting means that the comparison produces a value that’s never used, so the statement doesn’t have any visible effect on the program. It’s a hint that you probably want to rewrite it as something with a side-effect.

    Hope this helps!

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

Sidebar

Related Questions

I'm trying to compile a C++ project using Microsoft VisualStudio 2008. This particular project
Trying to compile a iPhone/iPad application with SDK3.2 and am getting this error: Undefined
When trying to compile this code: #include <iostream> #include <vector> using namespace std; class
While trying to compile a 64 bit linux kernel using gcc, I see the
When trying to compile the following code, I am getting a warning that line
While trying to compile an LLVM IR, like this llc main.ll -o main.s &&
I trying to compile this code: Int64 itag = BitConverter.ToInt64(temp, 0); itag &= 0xFFFFFFFFFFFFFC00;
I am trying to compile and run a simple SDL program on OSX 10.8.2,
*edit: this particular situation was created while I was trying to debug another problem,
I am new to Cuda, and I am trying to compile this simple test_1.cu

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.