Page 7 of 7 FirstFirst ... 567
Results 151 to 162 of 162

Thread: Scar++

  1. #151
    Join Date
    Dec 2007
    Location
    Somewhere in Idaho
    Posts
    480
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by fronty View Post
    MinGW works under Windows. Can you see MinGW in GCC tree? No.

    I know fpc is cross platform. Did I say it wasn't? No. I know I maybe didn't express my opinion very well, but what I meant was that fpc is an alternative for GCC for Pascal family, and one option like any other compiler for Pascal developement under Windows.

    You can get both ICC and VC for free.

    Some projects I've participated and which were supposed to be compilable with many compilers, including MSVC and GCC, without warnings, used macros for this purpose. IIRC in one project there was two macros, unused, and USE(). They were used and defined like this:
    Code:
    #ifdef __GNUC__
    # define unused __attribute__((unused))
    # define USE(x)
    #elif defined(_MSC_VER)
    # define unused
    # define USE(x) (x)
    #endif /* __GNUC__ */
    
    void func(int x unused)
    {
            USE(x);
            ...
    }
    I know this isn't very elegant solution, but I think it's better than long list of warnings.
    MingW is just gcc with a little extra code to handle POSTIX problems that happen on windows. Just because it isn't an official part of the gcc, doesn't mean it shouldn't be considered a gcc compiler.

    Using macros to eliminate warnings is retarded. Getting ride of them is ok. but trying to completely stamp them out by using bad coding practice is bad. I hate macros, and I wish that I could do this project without them. However, I can't do it without making two separate branches, so I've been burdened with the macros.

    But like I said, I prefer the GCC. Partially because I'm familiar with the kind of code it generates, partially because it is easier to get code to work for all platforms if it works with the gcc on one platform. I'm not saying that the MSVC is bad, I'm just less familiar with it.

  2. #152
    Join Date
    Sep 2009
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, MinGW is GCC port, but it's not pure GCC. If GCC would out of box without any special arrangements run on Windows, I would say GCC would support Windows. But now, I would just say you can run it on Windows and use it to produce PEs runnable on Windows.

    Wtf, does someone nowadays really meddle with assembly generated by compilers or use machine level debugger that much, that he can say he is familiar with code generated by some compiler? ;o

    It is useful to have one compiler which can be used on several platforms and works same way on every platform (if we don't care about ABI, etc.). But still the biggest concern is libraries, which don't depend on compilers. And compiler extension are just plain bad.

  3. #153
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,691
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by fronty View Post
    Yes, MinGW is GCC port, but it's not pure GCC. If GCC would out of box without any special arrangements run on Windows, I would say GCC would support Windows. But now, I would just say you can run it on Windows and use it to produce PEs runnable on Windows.

    Wtf, does someone nowadays really meddle with assembly generated by compilers or use machine level debugger that much, that he can say he is familiar with code generated by some compiler? ;o

    It is useful to have one compiler which can be used on several platforms and works same way on every platform (if we don't care about ABI, etc.). But still the biggest concern is libraries, which don't depend on compilers. And compiler extension are just plain bad.
    I'm pretty sure lots of people are familiar with code generated by GCC... Probably more than with ICC or Microsoft C Compiler. ( I'm sure you can guess why... )



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  4. #154
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by boberman View Post
    Amen brother, Amen... . Today and yesterday I haven't had a lot of time to work on this thing. Hopefully in the near future my schedule will free up a bit. (Sister had a baby, 12 lbs..)
    12 lbs? damn! is she alright?

  5. #155
    Join Date
    Sep 2009
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    I'm pretty sure lots of people are familiar with code generated by GCC... Probably more than with ICC or Microsoft C Compiler. ( I'm sure you can guess why... )
    I was wondering earlier this week, what kind of code does GCC generate for this C++ program?

    Code:
    #include <iostream>
    #include <sstream>
    #include <string>
    
    template< T >
    class a
    {
    private:
            T value;
    
    public:
            a(void) { }
            a(T val) :value(val) { }
    
            std::string serialize(void) {
                std::stringstream ss;
                ss << "<a><val>" << value << "</val></a>";
                return ss.str();
            }
    };
    
    int
    main(void)
    {
            a<int> foo('a');
            std::cout << foo.serialize() << std::endl;
            return 0;
    }
    It's such a good thing that here is people who are familiar with GCC's output code.

  6. #156
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,691
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by fronty View Post
    I was wondering earlier this week, what kind of code does GCC generate for this C++ program?

    Code:
    #include <iostream>
    #include <sstream>
    #include <string>
    
    template< T >
    class a
    {
    private:
            T value;
    
    public:
            a(void) { }
            a(T val) :value(val) { }
    
            std::string serialize(void) {
                std::stringstream ss;
                ss << "<a><val>" << value << "</val></a>";
                return ss.str();
            }
    };
    
    int
    main(void)
    {
            a<int> foo('a');
            std::cout << foo.serialize() << std::endl;
            return 0;
    }
    It's such a good thing that here is people who are familiar with GCC's output code.
    Bad thing you (presumably) don't know enough about C++ templates.

    However, Good thing gcc has the option to directly dump assembly it generates. (change gcc to g++)

    bash Code:
    gcc -O0 -S <yourfile>
    Last edited by Wizzup?; 10-16-2009 at 08:02 PM.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  7. #157
    Join Date
    Aug 2006
    Location
    London
    Posts
    2,021
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    I hope you trolling fronty, that code suggests you know almost nothing about templates.
    Join the Official SRL IRC channel. Learn how to Here.

  8. #158
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    I hope you trolling fronty, that code suggests there are people who actually think templates make more readable code.


    EDIT: Also, most large projects compile with warnings. Just forget about them.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  9. #159
    Join Date
    Sep 2009
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Damn, forgot 'class' from template. My fault. When correcting that, it compiles without any warning with Visual Studio 2008 and GCC 4.3.2. So syntatically and semantically it's completely correct, I think. I admit the way I build the string expects too much from type used with the class and the whole class is very horribly designed. But my point wasn't publishing some class library that can do miracles.

    I am familiar with different sorts of metaprogramming, including templates. I know it's possible to generate just asm with gcc and not to feed it automatically to assember, which is useful when learning at&t syntax.

    Many projects compile with warnings, but warnings point out many things that should be fixed. IMHO ignoring good advice is wrong.

    In right places templates let you reuse code, which imo is better than writing huge amount of code just to let you do same things with different datatypes.

    My point was that I think being familiar with code some compiler outputs is not something you can easily say in case of language like C++ if you don't work often with the compiler itself. Templates, virtual functions and different kinds of kinkinds of optimizations make it very hard, especially if you aren't familiar with the compiler's back end.

    EDIT: Wizzup, when generating just asm it doesn't matter do you use gcc or g++, both generate the same code. GCC is smart enough to choose the right compiler to use in compilation depending on file extension or flags. The difference is in linker's input.
    Last edited by fronty; 10-16-2009 at 08:44 PM.

  10. #160
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,691
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by fronty View Post
    Damn, forgot 'class' from template. My fault. When correcting that, it compiles without any warning with Visual Studio 2008 and GCC 4.3.2. So syntatically and semantically it's completely correct, I think. I admit the way I build the string expects too much from type used with the class and the whole class is very horribly designed. But my point wasn't publishing some class library that can do miracles.

    I am familiar with different sorts of metaprogramming, including templates. I know it's possible to generate just asm with gcc and not to feed it automatically to assember, which is useful when learning at&t syntax.

    Many projects compile with warnings, but warnings point out many things that should be fixed. IMHO ignoring good advice is wrong.

    In right places templates let you reuse code, which imo is better than writing huge amount of code just to let you do same things with different datatypes.

    My point was that I think being familiar with code some compiler outputs is not something you can easily say in case of language like C++ if you don't work often with the compiler itself. Templates, virtual functions and different kinds of kinkinds of optimizations make it very hard, especially if you aren't familiar with the compiler's back end.

    EDIT: Wizzup, when generating just asm it doesn't matter do you use gcc or g++, both generate the same code. GCC is smart enough to choose the right compiler to use in compilation depending on file extension or flags. The difference is in linker's input.
    Hmm.. I get your point; but I don't think that is what boberman referred to when he said he was familiar with the code it generates. At least not in that level of complexity. /me waits on a reaction by boberman.

    @ gcc/g++: OK. I didn't know that. I recall that when I first started with c++, I got errors because I was using gcc, and not g++ explicitly.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  11. #161
    Join Date
    Dec 2007
    Location
    Somewhere in Idaho
    Posts
    480
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by fronty View Post
    Yes, MinGW is GCC port, but it's not pure GCC. If GCC would out of box without any special arrangements run on Windows, I would say GCC would support Windows. But now, I would just say you can run it on Windows and use it to produce PEs runnable on Windows.

    Wtf, does someone nowadays really meddle with assembly generated by compilers or use machine level debugger that much, that he can say he is familiar with code generated by some compiler? ;o

    It is useful to have one compiler which can be used on several platforms and works same way on every platform (if we don't care about ABI, etc.). But still the biggest concern is libraries, which don't depend on compilers. And compiler extension are just plain bad.
    When you are taking high performance code. Yes, someone does indeed need to know what the low level stuff is doing . I couldn't really tell you what is going on with object oriented code or templates. That is a little complex. However, knowing how memory is packed, knowing what code is generated, and knowing how to tweak that code generation is pretty necessary when you talk about low level high speed code.

    I know it isn't implemented yet, however, I could easily see a day when scar++ has bits of assembly included in it.

  12. #162
    Join Date
    Sep 2009
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Good to hear what was the thinking behind you post so you don't talk about fence and I about nails in the fence.

    It is good to know some methods used by your compiler in code generation, especially when integrating asm with higher level code. However, in my opinion knowing how to optimize your algorithms and loops will lead to faster programs than doing some trickery with memory packing of your compiler, and it will work better programs with other compilers, too. Even writing some parts of program in assembly can be bad choice, because compiler bay be able to optimize some things and choose better instructions than you. But that is highly dependant on compiler, optimizing level, processor architecture and processor, and assembly programming skills.

    If you plan to write some parts in assembly, so long toolchain independence.

Page 7 of 7 FirstFirst ... 567

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 15
    Last Post: 09-22-2008, 12:32 PM
  2. SCAR Divi 3.01 DONT associate .scar files!!!
    By chimpy in forum News and General
    Replies: 1
    Last Post: 04-21-2007, 08:49 PM
  3. Replies: 28
    Last Post: 06-22-2006, 04:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •