Thread: Is there any up to date C++ to C converter?

  1. #16
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    There is always GAS. But even GAS is more platform independant than architecture independant. As you pointed out, the small nature of the project is important. Of course, if you are working with extremely limited system memory, chances are your program is going to stay quite compact too.

  2. #17
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Well, gas changes quite dramatically between ARM and x86, just to give two examples of processors. So it's kind of difficult to solve that problem, even if gas is slightly less difficult than if you also have to learn a new assembler syntax for pseudo-ops and other "assembler specific" bits.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #18
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Most definitely. I have typically only used GAS for ARM and used MASM for x86. I hate using GAS for x86 since it throws off my MASM mojo.

  4. #19
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    Quote Originally Posted by sept View Post
    Have you tried it?

    I am reading here.
    http://llvm.org/docs/FAQ.html#translatec++

    The three lines
    % llvm-g++ a.cpp -c
    % llvm-g++ b.cpp -c
    % llvm-g++ a.o b.o -o program
    work for me on widnows and program is executable.

    But program.bc will not be created. Idea why?
    http://llvm.org/docs/GettingStarted.html#tutorial

  5. #20
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Elysia View Post
    I'd say who needs a crap embedded system with 1k of memory instead?
    Yes. Who needs microwaves, dishwashers, wristwatches, or any of that other garbage? We all know that the only computers which exist are the ones that sit on your desk.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  6. #21
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by brewbuck View Post
    Yes. Who needs microwaves, dishwashers, wristwatches, or any of that other garbage? We all know that the only computers which exist are the ones that sit on your desk.
    No, who needs crap systems with 1k memory when they can put in a slightly more expensive system with lots of memory and a beefier processor for, oh what, $1 more?
    They need to stop cutting down on the embedded part of everything. It's destroying the experience for the customers and the programmers, alike.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #22
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Elysia View Post
    No, who needs crap systems with 1k memory when they can put in a slightly more expensive system with lots of memory and a beefier processor for, oh what, $1 more?
    They need to stop cutting down on the embedded part of everything. It's destroying the experience for the customers and the programmers, alike.
    And of course, producing 1 million machines at $1 more wouldn't make any difference to the profit of the company, I suppose. The two man months of extra work to squeeze the code into 1KB of memory instead of paying $1 more for the device will be well worth spending, I'm sure.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  8. #23
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by matsp View Post
    And of course, producing 1 million machines at $1 more wouldn't make any difference to the profit of the company, I suppose. The two man months of extra work to squeeze the code into 1KB of memory instead of paying $1 more for the device will be well worth spending, I'm sure.
    But you know it's possible to append +$1 to the price tag. I'm sure consumers won't really mind...
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #24
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Elysia View Post
    But you know it's possible to append +$1 to the price tag. I'm sure consumers won't really mind...
    But the price for a Brand X 800W microwave is pretty much determined by Brand A, Brand B and Brand C 800W microwaves. So increasing the price by $1 [at point of production, which turns into $5 at point of sale] will put Brand X's product higher than Brand A or Brand B's products that heat your dinner just the same. Ok, Brand X may be able to charge more because they advertise more on telly or have a well-known name from past history.

    If you consider that motherboard producers that produce $100+ motherboards for PC's will remove a resistor that costs $0.001 [yes, a tenth of a cent] if they think they can get away with it, you can certainly see how $1 would be critical to save when it comes to more cost sensitive products in the consumer area.

    In most consumer products, you do not know or care if the processor is a fast or slow one, or if the processor cost $1 or $2 each.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  10. #25
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by matsp View Post
    But the price for a Brand X 800W microwave is pretty much determined by Brand A, Brand B and Brand C 800W microwaves. So increasing the price by $1 [at point of production, which turns into $5 at point of sale] will put Brand X's product higher than Brand A or Brand B's products that heat your dinner just the same. Ok, Brand X may be able to charge more because they advertise more on telly or have a well-known name from past history.
    OK I won't argue with that, but surely there can be a progressive transition towards a little better hardware even if it means +$5 more. I mean, it can be a new product in their assortment or such.
    It's all about progressively phasing out old products and setting a new standard, you might say. When everyone starts putting in the same hardware, it will no biggie.
    I'm guessing they're cheap and want to save as much as possible?

    In most consumer products, you do not know or care if the processor is a fast or slow one, or if the processor cost $1 or $2 each.
    OK, so say in a microwave, I don't think I actually care, but other stuff such as DVDs and digital cameras, or portable media players - I really DO care.
    If I get a DVD, I expect it to be able to fast forward really fast (like them old VCRs) and not lag 1-5s entering or leaving a menu.
    And when getting a digital camera, I don't want the damn picture preview to lag because they were so cheap and couldn't put it a beefier processor. If so, I'd be better of with the good old cameras.
    And with portable media players, I expect to be able to play all of the advertised formats with max settings. Not some Profile 1 and 50% Profile 2 of H264 or whatever. Clearly not specs compliant and messes up everything because some people were cheap enough to save on the processor specs.
    And it doesn't take a very fast processor to decode it all - just efficient code!
    Last edited by Elysia; 09-11-2008 at 03:37 AM.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  11. #26
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I think the English word for "sortiment" would be "range of (products)" or some such [sorry, but it just looked wrong with the Swedish word in there].

    Yes, of course, a modern microwave will have much more fancy electronics than one produced 2-5 years ago - but it's still "make it as cost effective as possible so we can beat the competitions price". Software development cost is a fairly small part of the whole price in this market.

    When it comes to more computerized products, yes, specs of the processor, memory etc starts to become more important. But cost of the components is still a major factor, and putting a faster processor or bigger memory ONLY because you don't want to push the programmers to fit the code into the less expensive solution is still not the done thing on major consumer products (the digital cameras in the $50-200 bracket, or sub $100 DVD players, etc - it is "price matters" in this type of product). And I have no idea how fast the DigIC processor that Canon uses in their latest DSLR's cost, or how fast it is - but I'm sure there is a faster/more expensive variant possible if they wanted to do that - even for the top end 1DsMkIII.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  12. #27
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    If you were running a regular computer on an embedded processor, then I'd probably agree with you. Then you could take advantage of the extra processing power. But in embedded components, the processor is a means to an end. You won't run other software on it, and it will just do its job. Then it just becomes a matter of price, as Mats pointed out.
    Last edited by robwhit; 09-11-2008 at 08:06 AM.

  13. #28
    Registered User
    Join Date
    Jul 2007
    Posts
    88
    To be honest, you are talking about lot of things here but not that much what I asked. C++ to C converters.

    Is there really only one?

  14. #29
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by sept View Post
    To be honest, you are talking about lot of things here but not that much what I asked. C++ to C converters.

    Is there really only one?
    Considering that the ONLY reason why you would want one is that you have a working C compiler, but not a C++ compiler, and that a large volume of compilers come as a pair of a C++ and a C compiler, yes, I'm not entirely surprised that there isn't many of them - it's not exactly something that is easy to achieve. The one you have a link to isn't the most clever way to do it either, so I'm not sure how much help it would be - it would certainly be fiarly difficult to debug and understand the code in the target system.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  15. #30
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    How did this work out for you?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Advancing day by day until it matches a second date
    By nhubred in forum C++ Programming
    Replies: 1
    Last Post: 05-30-2009, 08:55 AM
  2. Checking array for string
    By Ayreon in forum C Programming
    Replies: 87
    Last Post: 03-09-2009, 03:25 PM
  3. Date program starts DOS's date
    By jrahhali in forum C++ Programming
    Replies: 1
    Last Post: 11-24-2003, 05:23 PM
  4. CDate Class - handle date manipulation simply
    By LuckY in forum C++ Programming
    Replies: 5
    Last Post: 07-16-2003, 08:35 AM