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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:35:23+00:00 2026-05-13T14:35:23+00:00

The parameters -S -save-temps work fine, as long as i don’t use them on

  • 0

The parameters -S -save-temps work fine, as long as i don’t use them on files with the same name.

Think of the following situation: I have a project with a main directory and a subdirectory with the name subDir and in both of the directories are files placed with the name file.c. If I now call gcc -S -save-temps file.cpp subDir/file.c only one intermediate file with the name file.i will be generated.

That is the expected behaviour, as the man file of gcc tells me, that the intermediate files will always be placed in the current path, when using -save-temps.

My problem is, that I’m working on projects I don’t know in advance. It could very well be, that someone constructed the above mentioned example in his Makefiles. In that case I would be stuck, because I need both intermediate files.

A few words to the system I’m constructing (for better understanding): My tool uses make --just-print to collect the calls, a make file of a project invokes. I scan these calls for compiler calls and add the -save-temps and -S options. The purpose is to get every preprocessed file, that is used in the process of compiling the project.

Do you have any ideas, how I’m able to get every preprocessed file, even if the above mentioned example should appear?

  • 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-13T14:35:24+00:00Added an answer on May 13, 2026 at 2:35 pm

    There’s no problem with file.cpp / file.c in different directories. GCC will create a *.ii and a *.i depending on the files’ extension.

    If they both have c||cpp you can use -E and receive only one *.i where you can search for the pragma # 1 "<FILE_PATH>" and extract it via a script.

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

Sidebar

Related Questions

HI I have the following routing table routes.MapRoute(null, Save, // Route name new {
Query parameters : http://example.com/apples?order=random&color=blue Matrix parameters : http://example.com/apples;order=random;color=blue When should one use query parameters
I need to solve the following question which i can't get to work by
Parameters are used to protect you from malicious user input. But if the parameter
Why are 'out' parameters in .NET a bad idea? I was recently asked this,
Many of the parameters for interacting with the Office Object model in VSTO require
Routines can have parameters, that's no news. You can define as many parameters as
Can Eclipse make parameters for generated methods (overwriting, implementing interface, etc.) final, and if
I have to pass parameters between two rails apps. In one side (sender) I
M sending the parameters from the jsp page, the code is <s:url id=url action=searchAction>

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.