Giter Club home page Giter Club logo

glimpse's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

glimpse's Issues

Remove unnecessary null pointer checks

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"?

Compilation fails due to -Wreturn-type errors

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)

Tag releases

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.

Build fails because of missing ./lib and ./bin directories

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.

dynfilters/Makefile: make target does not honor previously configured LDFLAGS

Found in version:

$ glimpse -V
This is glimpse version 4.18.7, 2015.

How to reproduce the issue?

  1. Run an environment where libfl is not installed in the system.
  2. Have libfl installed locally under path defined as $DEVLIBPATH/lib.
  3. Execute: ./configure --prefix=$DEVLIBPATH LDFLAGS='-L$DEVLIBPATH/lib'
  4. Check contents of 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

Return type "void" for "my_free"

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_*/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.