Work in your project
Hi guys, In next three years I'm going to get the scientific degree in System programming. That's why I'm looking for the interesting and actual theme not like a new bicycle with square rings. My degree work in university was connected with value range propagation (VRP) functionality in clang static analyzer based on AST. I founded it rather interesting and want to follow this direction with your project. As i know, VRP is a not new theme, and llvm and gcc projects already have the similar feature. It would be nice, if you suggest me good theme or give me the area where I could find it. -- Best regards, Sergey
How to run a compiled C program?
The avr backend auto-generates a part of the texi documentation by means of a small C program. The relevant part of t-avr reads: s-avr-mmcu-texi: gen-avr-mmcu-texi$(build_exeext) $(RUN_GEN) $< | sed -e 's:\r::g' > avr-mmcu.texi There was a problem report that the executable cannot be found. When I wrote that I checked other uses of RUN_GEN (which is empty) in $(builddir)/gcc/Makefile that do calls like $(RUN_GEN) build/... What is the correct way to call the executable? Add ./ like so? s-avr-mmcu-texi: gen-avr-mmcu-texi$(build_exeext) $(RUN_GEN) ./$< | sed -e 's:\r::g' > avr-mmcu.texi Thanks for hints. Johann
How to compare two text files? Using sed, cmp, diff, tr?
The avr backend auto-generates parts of GCC's texi documentation, namely the supported -mmcu= options, which are about 200. To generate the texi a small C program is used to print the texi to stdout, and that output is then compared against the already existing doc/avr-mmci.texi If the output is the same like in that file, nothing happens. If the output differs from that file, the user (someone building the avr compiler) is nagged to update the existing documentation so that the documentation says in sync with the compiler. The part of t-avr reads: s-avr-mmcu-texi: gen-avr-mmcu-texi$(build_exeext) $(RUN_GEN) $< | sed -e 's:\r::g' > avr-mmcu.texi @if cmp -s $(srcdir)/doc/avr-mmcu.texi avr-mmcu.texi; then \ $(STAMP) $@; \ else\ echo >&2 ; \ echo "***" >&2 ; \ echo "*** Verify that you have permission to grant a" >&2 ; \ echo "*** GFDL license for all new text in" >&2 ;\ echo "*** avr-mmcu.texi,then copy it to $(srcdir)/doc/avr-mmcu.texi" >&2 ; \ echo "***" >&2 ; \ false;\ fi The problem is comparing the new texi file avr-mmcu.texi against the already existing $(srcdir)/doc/avr-mmcu.texi and factor out different line endings that depend on the build system like LF vs. CRLF. What is the best way to do such a comparison on text level without getting a complaint if the original texi was built on linux and the user builds the compiler under, say, windows? How to cope with different line endings in that case? The sed -e 's:\r::g' from above that tries to fix line endings has the problem that not all sed implementations are the same, i.e. some just do sed -e 's:r::g' and remove all r's. I searched some time how to accomplish this but did not find a neat solution. Can tr from roff be used? Is it a valid prerequisite for GCC? Or open a binary file to write the test instead of printf+stdout? And just omit the sed and don't care at all? Is there a valid compare tool that compares text modulo line-endings? Setting an svn: property so that the texi is binary and not text? Thanks Johann
Re: How to compare two text files? Using sed, cmp, diff, tr?
Georg-Johann Lay wrote: The avr backend auto-generates parts of GCC's texi documentation, namely the supported -mmcu= options, which are about 200. To generate the texi a small C program is used to print the texi to stdout, and that output is then compared against the already existing doc/avr-mmci.texi If the output is the same like in that file, nothing happens. If the output differs from that file, the user (someone building the avr compiler) is nagged to update the existing documentation so that the documentation says in sync with the compiler. The part of t-avr reads: s-avr-mmcu-texi: gen-avr-mmcu-texi$(build_exeext) $(RUN_GEN) $< | sed -e 's:\r::g' > avr-mmcu.texi @if cmp -s $(srcdir)/doc/avr-mmcu.texi avr-mmcu.texi; then \ $(STAMP) $@;\ else\ echo >&2 ;\ echo "***" >&2 ;\ echo "*** Verify that you have permission to grant a" >&2 ;\ echo "*** GFDL license for all new text in" >&2 ; \ echo "*** avr-mmcu.texi,then copy it to $(srcdir)/doc/avr-mmcu.texi" >&2 ; \ echo "***" >&2 ;\ false; \ fi The problem is comparing the new texi file avr-mmcu.texi against the already existing $(srcdir)/doc/avr-mmcu.texi and factor out different line endings that depend on the build system like LF vs. CRLF. What is the best way to do such a comparison on text level without getting a complaint if the original texi was built on linux and the user builds the compiler under, say, windows? How to cope with different line endings in that case? Instead of trying to cope with different line endings on the generated files, wouldn't it be better to modify the C program to output the desired line ending format in the first place? Instead of just writing a \n in text mode, output \n\r in binary mode (if you want DOS format), or just \n (for unix format). I'd think changing the line ending format on a file should be considered a problem, as the distributed files could end up in numerous formats, making nobody really happy.
Re: How to compare two text files? Using sed, cmp, diff, tr?
On 26 May 2012 11:01, Georg-Johann Lay wrote: > > Is there a valid compare tool that compares text modulo line-endings? POSIX diff with the -b option should report the files as equal, I don't know if that's portable enough to rely on though.
Re: How to compare two text files? Using sed, cmp, diff, tr?
As Jonathan Wakely wrote: > POSIX diff with the -b option should report the files as equal, I > don't know if that's portable enough to rely on though. I think it is. The Single Unix Specification requires the -b option ("Cause any amount of white space at the end of a line to be treated as a single "), and the exit status 0 for "no differences found", 1 for "differences found", and > 1 for "an error occurred" are also standardized. I don't know of any (even historic) diff that doesn't provide -b. There's no option to suppress printing the differences to stdout though, and redirecting the output to a null device is likely not portable. I don't know whether this situation already applies to other GCC Makefiles, but perhaps the most portable way for this is to redirect stdout to a dummy file, and delete that file afterwards. -- cheers, J"org .-.-. --... ...-- -.. . DL8DTL http://www.sax.de/~joerg/NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)
Re: Work in your project
On 12-05-26 04:46 , Serg Anohovsky wrote: It would be nice, if you suggest me good theme or give me the area where I could find it. You can find GCC's VRP implementation in the file gcc/tree-vrp.c in the source repository http://gcc.gnu.org/viewcvs/trunk/gcc/tree-vrp.c?view=markup The file has links to documentation and articles where it was originally implemented from (though it has changed substantially since its original implementation). If you are interested in projects other than VRP, you can visit our getting started page: http://gcc.gnu.org/wiki/GettingStarted Diego.
Re: How to compare two text files? Using sed, cmp, diff, tr?
Quoting Georg-Johann Lay : The avr backend auto-generates parts of GCC's texi documentation, namely the supported -mmcu= options, which are about 200. I hope that autogenerated documentation is still helpful then. Sometimes an overabundance of verbose documentation can prevent a user from finding what (s)he needs. The sed -e 's:\r::g' from above that tries to fix line endings has the problem that not all sed implementations are the same, i.e. some just do sed -e 's:r::g' and remove all r's. I searched some time how to accomplish this but did not find a neat solution. Can tr from roff be used? Is it a valid prerequisite for GCC? tr is already used in a number of places in Makefile.in. Note that there is a distinction between tools required to rebuild auto-generated files, and tool required to build GCC assuming all auto-generated files are up-to-date. You should make it so that tr is not used if the timestamps indicate that the documentation is up-to-date. Look for the s-tm-texi rule in Makefile.in, it normalizes the line ending using tr (while taking care of a Solaris oddity), before comparing it to the existing version. Or open a binary file to write the test instead of printf+stdout? That just shifts the portability issues to how to open a file for binary writing. Not all platforms support open(2). Some platforms need "b" for fopen, others reject it. And then you have to make sure that what you write really makes sense for binary writing on all platforms, when you naturally describe the data as text.
Re: How to run a compiled C program?
Georg-Johann Lay writes: > The avr backend auto-generates a part of the texi documentation by > means of a small C program. The relevant part of t-avr reads: > > s-avr-mmcu-texi: gen-avr-mmcu-texi$(build_exeext) > $(RUN_GEN) $< | sed -e 's:\r::g' > avr-mmcu.texi > > > There was a problem report that the executable cannot be found. > > When I wrote that I checked other uses of RUN_GEN (which is empty) in > $(builddir)/gcc/Makefile that do calls like $(RUN_GEN) build/... > > What is the correct way to call the executable? Add ./ like so? > > s-avr-mmcu-texi: gen-avr-mmcu-texi$(build_exeext) > $(RUN_GEN) ./$< | sed -e 's:\r::g' > avr-mmcu.texi Yes. Ian
Re: How to compare two text files? Using sed, cmp, diff, tr?
Joern Rennecke writes: > Some platforms need "b" for fopen, others reject it. Hmm, really? "b" seems to standard in ISO-C (and widely used in programs aiming for portability)... -miles -- Bore, n. A person who talks when you wish him to listen.
gcc-4.7-20120526 is now available
Snapshot gcc-4.7-20120526 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/4.7-20120526/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 4.7 SVN branch with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch revision 187917 You'll find: gcc-4.7-20120526.tar.bz2 Complete GCC MD5=563397211aed0e7fc0584afb8d04c089 SHA1=4c7e567445141acb796e2d03cbe8812e2c6c6056 Diffs from 4.7-20120519 are available in the diffs/ subdirectory. When a particular snapshot is ready for public consumption the LATEST-4.7 link is updated and a message is sent to the gcc list. Please do not use a snapshot before it has been announced that way.