gvelez17 / glimpse Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
An extra null pointer check is not needed in functions like the following.
Would you like to add the following semantic patch approach to a test directory?
@Remove_unnecessary_pointer_checks1@
expression x;
@@
-if (\(x != 0 \| x != NULL\))
free(x);
@Remove_unnecessary_pointer_checks2@
expression x;
@@
-if (\(x != 0 \| x != NULL\)) {
free(x);
x = \(0 \| NULL\);
-}
@Remove_unnecessary_pointer_checks3@
expression a, b;
@@
-if (\(a != 0 \| a != NULL\) && \(b != 0 \| b != NULL\))
+if (a)
free(b);
@Remove_unnecessary_pointer_checks4@
expression a, b;
@@
-if (\(a != 0 \| a != NULL\) && \(b != 0 \| b != NULL\)) {
+if (a) {
free(b);
b = \(0 \| NULL\);
}
How do you think about to apply a corresponding update suggestion which can be generated by the software "Coccinelle"?
Environment:
gcc --version
Configured with: --prefix=/Applications/Xcode_6.4.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
I get lots of errors about functions which don't declare a return type.
In order to fix it, I had to ./configure CC='gcc -Wno-return-type -std=gnu89'
(Also separate issues: I had to create directories lib and bin or the make failed)
This git repository contains contains no tags. Please publish a tag for each version of glimpse that was released, up to the latest 4.18.6 released in 2008 according to https://web.archive.org/web/20191206221705/http://webglimpse.net/.
Since the web site that used to host glimpse no longer exists, it's important to preserve the history of the project here on github, including tags of existing versions, and the original tarballs attached to those releases.
Both a git clone of the repository and the zip file download do not include ./bin and ./lib directories. Their absence causes make to fail. Either the Makefile should be modified to build these directories or absent, or more simply, these empty directories should be added to the repository.
Would you like to consider change suggestions for your build specification by the tool "autoupdate"?
I would like to point out that identifiers like "_GLIMPSE_H_
" and "_PATHS_H_
" do not fit to the expected naming convention of the C language standard.
Would you like to adjust your selection for unique names?
Found in version:
$ glimpse -V
This is glimpse version 4.18.7, 2015.
How to reproduce the issue?
$DEVLIBPATH/lib
../configure --prefix=$DEVLIBPATH LDFLAGS='-L$DEVLIBPATH/lib'
dynfilters/Makefile
file where LDFLAGS
is defined as LDFLAGS=
Workaround:
There are two ways to proceed with compilation.
First approach depends on your compiler. If you use GCC, you can insert $DEVLIBPATH/lib
into LIBRARY_PATH
variable. This will guide the compiler to search that path for libfl (-lfl
) instead of failing. LIBRARY_PATH
is different than LD_LIBRARY_PATH
so pay attention.
Second approach relies on dirty replacement of LDFLAGS
to match what was passed during ./configure ...
step. After performing step 3, run sed
to replace LDFLAGS
with the expected value:
sed 's!^LDFLAGS=$!LDFLAGS='-L$DEVLIBPATH/lib'!' dynfilters/Makefile
After applying this workaround, you should be able to proceed with make && make check && make install
How do you think about to integrate the following small update suggestion into your source code repository?
diff --git a/glimpse/index/glimpse.h b/glimpse/index/glimpse.h
index 317b8c8..2df9414 100644
--- a/glimpse/index/glimpse.h
+++ b/glimpse/index/glimpse.h
@@ -216,7 +216,7 @@ struct offsets {
/* Memory allocators: in io.c */
extern char *my_malloc();
-extern int my_free();
+extern void my_free();
extern FILE *my_fopen();
extern int my_open(), my_stat(), my_lstat();
extern char *wordalloc();
diff --git a/glimpse/index/region.h b/glimpse/index/region.h
index 9615c73..7b50486 100644
--- a/glimpse/index/region.h
+++ b/glimpse/index/region.h
@@ -28,5 +28,5 @@ typedef struct ATTR_ELEMENT {
extern FILE *my_fopen();
extern char *my_malloc();
-extern int my_free();
+extern void my_free();
#endif /*_REGION_H_*/
diff --git a/index/glimpse.h b/index/glimpse.h
index 317b8c8..2df9414 100644
--- a/index/glimpse.h
+++ b/index/glimpse.h
@@ -216,7 +216,7 @@ struct offsets {
/* Memory allocators: in io.c */
extern char *my_malloc();
-extern int my_free();
+extern void my_free();
extern FILE *my_fopen();
extern int my_open(), my_stat(), my_lstat();
extern char *wordalloc();
diff --git a/index/io.c b/index/io.c
index 5ce5837..7844caf 100644
--- a/index/io.c
+++ b/index/io.c
@@ -659,7 +659,7 @@ my_malloc(len)
return s;
}
-my_free(ptr, size)
+void my_free(ptr, size)
void *ptr;
int size;
{
diff --git a/index/region.h b/index/region.h
index 9615c73..7b50486 100644
--- a/index/region.h
+++ b/index/region.h
@@ -28,5 +28,5 @@ typedef struct ATTR_ELEMENT {
extern FILE *my_fopen();
extern char *my_malloc();
-extern int my_free();
+extern void my_free();
#endif /*_REGION_H_*/
I have looked at a few source files for your current software. I have noticed that some checks for return codes are missing.
Would you like to add more error handling for return values from functions like the following?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.