[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 6bca933: Initialized BuildProgram's internal o
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 6bca933: Initialized BuildProgram's internal optimize and warning strings |
Date: |
Mon, 22 May 2017 09:40:12 -0400 (EDT) |
branch: master
commit 6bca933d8792a5faefe22fc08fb978494ab9dde4
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>
Initialized BuildProgram's internal optimize and warning strings
These two strings were not initialized in BuildProgram, which could give
undefined behavior. They are now both initialized to NULL.
Also, in the documentation, an example for optimizations was given.
---
bin/buildprog/buildprog.c | 2 +-
doc/gnuastro.texi | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/bin/buildprog/buildprog.c b/bin/buildprog/buildprog.c
index b5d7363..155ec10 100644
--- a/bin/buildprog/buildprog.c
+++ b/bin/buildprog/buildprog.c
@@ -71,7 +71,7 @@ buildprog(struct buildprogparams *p)
/* Note that the first node of `sourceargs' is the acutal source and the
rest are arguments to be run later. */
int retval;
- char *command, *optimize, *warning;
+ char *command, *optimize=NULL, *warning=NULL;
char *include = buildprog_as_one_string("-I", p->include);
char *linkdir = buildprog_as_one_string("-L", p->linkdir);
char *linklib = buildprog_as_one_string("-l", p->linklib);
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index d4c485b..66c1aec 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -16614,6 +16614,9 @@ One line examples:
## Compile, link and run `myprogram.c':
$ astbuildprog myprogram.c
+## Similar to previous, but with optimization and compiler warnings:
+$ astbuildprog -Wall -O2 myprogram.c
+
## Compile and link `myprogram.c', then run it with `image.fits'
## as its argument:
$ astbuildprog myprogram.c image.fits
@@ -16703,8 +16706,8 @@ variable or change the program counter to any other
statement in the
function and get exactly the results you expect from the source
code. Turning on optimization flags makes the compiler attempt to improve
the performance and/or code size at the expense of compilation time and
-possibly the ability to debug the program.'' See there for the full list of
-acceptable values to this option (also standard among other compilers).
+possibly the ability to debug the program.'' See your compiler's manual for
+the full list of acceptable values to this option.
@item -g
@itemx --debug
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnuastro-commits] master 6bca933: Initialized BuildProgram's internal optimize and warning strings,
Mohammad Akhlaghi <=