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

  • Home
  • SEARCH
  • 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 8445511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:40:40+00:00 2026-06-10T09:40:40+00:00

When compiling something as simple as inline int test() { return 3; } int

  • 0

When compiling something as simple as

inline int test() { return 3; }

int main()
{
 test();
 return 0;
}

with gcc -c test.c, everything goes fine. If the -ansi keyword added, gcc -ansi -c test.c, one gets the error message

test.c:1:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’

This is true even if the C99 standard is explicitly selected, gcc -std=c99 -ansi -c test.c.

What is the reason for this, and is there a recommended fix?

  • 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-10T09:40:41+00:00Added an answer on June 10, 2026 at 9:40 am

    You need to use:

    gcc -std=c99 -c test.c
    

    The -ansi flag specifies c90:

    The -ansi option is equivalent to -std=c90.

    ANSI C was effectively the 1990 version of C, which didn’t include the inline keyword.

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

Sidebar

Related Questions

Recently I tried compiling program something like this with GCC: int f(int i){ if(i<0){
I'm trying to compile a simple application in linux. My main.cpp looks something like
I disassembled the code resulting from compiling the very simple source file test.c, which
I'm disappointed that dart doesn't feature weak references. Is there something about compiling to
This is something stupid I probably should know, but Googling fails me: When compiling
I'm learning about references and pointers, and something in the tutorial isn't compiling for
I have the code: unsigned int length = strlen(somestring); I'm compiling with the warning
In compiling qt I found that there is a qws target called arm-linux-gcc. I
So, in a non-class type of situation, I can do something like this: int
I am trying to write a simple parallel_for using pthreads. Original code is something

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.