Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How To Look At GCC C Sources

How To Look At GCC C Sources

Scheduled Pinned Locked Moved C / C++ / MFC
collaborationquestionc++com
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Frederick J Harris
    wrote on last edited by
    #1

    How does one view/obtain the GCC C sources? I don’t know how to use git. I just downloaded a Windows version yesterday (haven’t installed it yet), and am studying an ebook on it. Or should I use GitHub? I don’t know anything about these things. Is there an easier way to do it? Is there an ftp site where you can just download it from without having to learn/use some complicated source code management system? I’ve nearly completed writing my own version of only what I need from the C Standard Library, and all I need from the C++ Standard Library is a String Class, and I’ve used my own for many, many years which works fine. The only thing I need yet is a full implementation of pow, and possibly exp if pow needs that, and I don’t know how to do it myself. That’s why I need to study and learn from the GCC C sources. I’m linking without the Standard Libraries so as to avoid the bloat, and using Windows. But if I’d have asked here first how to implement pow, within 1 minute of posting that question I’d have been told to look at the GCC sources, which I don’t know how to do. That’s why I’m asking for instruction here first on that. Once I’ve figured out how to get at the GCC sources, then I can tackle my pow issue. I'm not the only one baffled by this... Apparently, I downloaded the wrong program ( git ), and am studying the wrong book. Apparently I've got to learn how to use svn before I can even attempt this? This is ridiculous, in my opinion. I guess what I'm looking for is a list of all the hoops I've got to jump through to get what I want. Something like this... 1) Download and install Subversion (and hope there is a Windows version of it); 2) Buy a book that teaches how to use Subversion; 3) Figure out how to use Subversion to navigate to GCC sources; 4) Find pow or exp and figure out how it works; Is the above what I should do, or is there some other route?

    L J 2 Replies Last reply
    0
    • F Frederick J Harris

      How does one view/obtain the GCC C sources? I don’t know how to use git. I just downloaded a Windows version yesterday (haven’t installed it yet), and am studying an ebook on it. Or should I use GitHub? I don’t know anything about these things. Is there an easier way to do it? Is there an ftp site where you can just download it from without having to learn/use some complicated source code management system? I’ve nearly completed writing my own version of only what I need from the C Standard Library, and all I need from the C++ Standard Library is a String Class, and I’ve used my own for many, many years which works fine. The only thing I need yet is a full implementation of pow, and possibly exp if pow needs that, and I don’t know how to do it myself. That’s why I need to study and learn from the GCC C sources. I’m linking without the Standard Libraries so as to avoid the bloat, and using Windows. But if I’d have asked here first how to implement pow, within 1 minute of posting that question I’d have been told to look at the GCC sources, which I don’t know how to do. That’s why I’m asking for instruction here first on that. Once I’ve figured out how to get at the GCC sources, then I can tackle my pow issue. I'm not the only one baffled by this... Apparently, I downloaded the wrong program ( git ), and am studying the wrong book. Apparently I've got to learn how to use svn before I can even attempt this? This is ridiculous, in my opinion. I guess what I'm looking for is a list of all the hoops I've got to jump through to get what I want. Something like this... 1) Download and install Subversion (and hope there is a Windows version of it); 2) Buy a book that teaches how to use Subversion; 3) Figure out how to use Subversion to navigate to GCC sources; 4) Find pow or exp and figure out how it works; Is the above what I should do, or is there some other route?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Frederick J. Harris wrote:

      This is ridiculous, in my opinion.

      Many things are. However, if you want source code then you have to go and search for it. Have you tried the GNU website[^]?

      F 1 Reply Last reply
      0
      • L Lost User

        Frederick J. Harris wrote:

        This is ridiculous, in my opinion.

        Many things are. However, if you want source code then you have to go and search for it. Have you tried the GNU website[^]?

        F Offline
        F Offline
        Frederick J Harris
        wrote on last edited by
        #3

        I think I'm on the right track Richard. I downloaded Subversion for Windows from SourceForge, but it doesn't look like I have to use it. By replacing svn:// with http:// I can browse to sources as just ftp folders. I've gotten this far... https://gcc.gnu.org/svn/gcc/trunk/ https://gcc.gnu.org/svn/gcc/trunk/libgcc/ Perhaps I just need to spend some time searching for pow. Haven't found it yet.

        L 1 Reply Last reply
        0
        • F Frederick J Harris

          I think I'm on the right track Richard. I downloaded Subversion for Windows from SourceForge, but it doesn't look like I have to use it. By replacing svn:// with http:// I can browse to sources as just ftp folders. I've gotten this far... https://gcc.gnu.org/svn/gcc/trunk/ https://gcc.gnu.org/svn/gcc/trunk/libgcc/ Perhaps I just need to spend some time searching for pow. Haven't found it yet.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Frederick J. Harris wrote:

          searching for pow

          ... probably in a file named math.c, or similar.

          1 Reply Last reply
          0
          • F Frederick J Harris

            How does one view/obtain the GCC C sources? I don’t know how to use git. I just downloaded a Windows version yesterday (haven’t installed it yet), and am studying an ebook on it. Or should I use GitHub? I don’t know anything about these things. Is there an easier way to do it? Is there an ftp site where you can just download it from without having to learn/use some complicated source code management system? I’ve nearly completed writing my own version of only what I need from the C Standard Library, and all I need from the C++ Standard Library is a String Class, and I’ve used my own for many, many years which works fine. The only thing I need yet is a full implementation of pow, and possibly exp if pow needs that, and I don’t know how to do it myself. That’s why I need to study and learn from the GCC C sources. I’m linking without the Standard Libraries so as to avoid the bloat, and using Windows. But if I’d have asked here first how to implement pow, within 1 minute of posting that question I’d have been told to look at the GCC sources, which I don’t know how to do. That’s why I’m asking for instruction here first on that. Once I’ve figured out how to get at the GCC sources, then I can tackle my pow issue. I'm not the only one baffled by this... Apparently, I downloaded the wrong program ( git ), and am studying the wrong book. Apparently I've got to learn how to use svn before I can even attempt this? This is ridiculous, in my opinion. I guess what I'm looking for is a list of all the hoops I've got to jump through to get what I want. Something like this... 1) Download and install Subversion (and hope there is a Windows version of it); 2) Buy a book that teaches how to use Subversion; 3) Figure out how to use Subversion to navigate to GCC sources; 4) Find pow or exp and figure out how it works; Is the above what I should do, or is there some other route?

            J Offline
            J Offline
            Jochen Arndt
            wrote on last edited by
            #5

            What you are looking for are the glibc sources (the C standard library) and not the GCC sources (the GNU compiler collection). Glibc download: The GNU C Library[^]; download without using Git: Index of /gnu/glibc[^]. The pow() and exp() functions are part of the math library which depends on the target platform processor. Once you have unpacked the glibc sources, these functions can be found here for x86 CPUs (file names for double):

            • sysdeps/i386/fpu/e_pow.S: Implementation using the x87 math coprocessor.
            • sysdeps/ieee754/dbl-64/e_pow.c: Implementation in plain C.

            The FPU implementation is in assembler and should not need any other functions. The IEEE implementation needs other modules (at least e_exp.c) and some header files.

            F 1 Reply Last reply
            0
            • J Jochen Arndt

              What you are looking for are the glibc sources (the C standard library) and not the GCC sources (the GNU compiler collection). Glibc download: The GNU C Library[^]; download without using Git: Index of /gnu/glibc[^]. The pow() and exp() functions are part of the math library which depends on the target platform processor. Once you have unpacked the glibc sources, these functions can be found here for x86 CPUs (file names for double):

              • sysdeps/i386/fpu/e_pow.S: Implementation using the x87 math coprocessor.
              • sysdeps/ieee754/dbl-64/e_pow.c: Implementation in plain C.

              The FPU implementation is in assembler and should not need any other functions. The IEEE implementation needs other modules (at least e_exp.c) and some header files.

              F Offline
              F Offline
              Frederick J Harris
              wrote on last edited by
              #6

              Thanks very much Richard and Jochen. It dawned on me yesterday afternoon while taking a walk (which is how I solve most of my programming problems) that I needed libc - not GNU GCC sources. Just now before checking in here I managed to download libc in tarball format. Now I need to see if I have an app to extract tarballs. I much appreciate your help! Thanks very much!

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups