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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:41:58+00:00 2026-06-09T05:41:58+00:00

My work place is developing code for some absolutely ancient hardware that doesn’t have

  • 0

My work place is developing code for some absolutely ancient hardware that doesn’t have virtual memory. Because of this we’re trying to be careful to minimize the text size of object and binary files, so we don’t run out of memory. This likely means we’ll need to limit the use of templates from the STL, or ban them outright. While looking around to find a way to minimize the size of our files, and still use templates, I came across the -frepo option for g++. A few tests later, I’m even more confused than when I started. The final binary file is the same size or larger when the -frepo is used, which doesn’t make sense from me. Can anyone explain to me what this option actually does (other than “it just works,” as that’s the explanation from the GCC 4.7.1 manual) and how I might be abusing it?

Compiling with g++ -c -frepo main.cpp test8.cpp and linking with g++ test8.o main.o
The .rpo files arebeing created.

test8.h:

#include <list>
using namespace std;

class Test
{
  public:
    Test ();
    list<int> makeNewIntList ();
  private:
  list<int> intList;
};

test8.cpp:

#include "test8.h"
#include <list>

using namespace std;

Test::Test()
{
  intList = list<int>( 10, 12 );
}

list<int> Test::makeNewIntList()
{
  intList.push_back(4);
  return intList;
}

main.cpp

#include "test8.h"

using namespace std;

void findFive (int num);
list<int> makeIntList();

int main( int argc, char* argv[])
{
  Test test;
  list<int> intList = test.makeNewIntList();
  list<int> intList2 = makeIntList();
  list<float> floatList = list<float> (10,12);
  floatList.push_back(5);
}

list<int> makeIntList()
{
  list<int> intList = list<int> (10,12);
  return intList;
}

We are using GCC 4.1.2. Also note GCC 4.7.0 isn’t much better, and upgrading the compiler isn’t a viable solution.

  • 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-09T05:42:00+00:00Added an answer on June 9, 2026 at 5:42 am

    I would advise that you forget about -frepo, it’s a relic and hardly used.

    Instead you could look at the extern template syntax for declaring explicit instantiations, to prevent templates being instantiated implicitly, allowing you to control the instantiations so they only happen in one place. To be sure you don’t miss any you could also compile with -fno-implicit-templates (which isn’t necessary if you’re rigorous about using extern template declarations everywhere necessary.)

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

Sidebar

Related Questions

At my place of work we have a legacy document management system that for
I happen to come across a Java code at my work place. Here's the
At the place I work at, we have a custom security/authentication mechanism for internal
At my current place of work we have a set way of going about
I'm currently researching a project for the place that I work in. We are
We are developing a web app that enables the end user to place a
I have a question regarding Git. The place where I work has 2 developers:
We're developing an application that will have a plug-in architecture to allow consumers of
I am developing an application that needs to work on Linux, Windows and Mac
My DBA just lost some development work that he did on our development database.

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.