cangfengzhe / ea-utils

Automatically exported from code.google.com/p/ea-utils
0 stars 0 forks source link

Patches for porting ea-utils to other POSIX platforms + warnings clean-up #40

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Build on a FreeBSD, OS X, or other non-Linux system using clang.

What is the expected output? What do you see instead?

A few bugs, many style warnings, some run-time errors due to the use of 
getopt() GNU extensions.

What version of the product are you using? On what operating system?

1.1.2 on FreeBSD and OS X.

Please provide any additional information below.

First, thanks for making this software readily available.  Some of our 
researchers expect to find it very useful.

I have attached a set of patches necessary to build on FreeBSD with clang, 
which is highly compatible with gcc, but a bit more verbose by default.

I found a few genuine bugs like "if (!o_n < MAX_FILES)" and patched a bunch of 
style warnings to silence the compiler.  There are more style warnings, mostly 
related to missing return values, but I left them for now.  I would suggest 
compiling with gcc -Wall to uncover potential problems like these.  I've found 
it very helpful in identifying real bugs, even though most of the warnings it 
produces are innocuous.

I also altered some of the getopt() loops to make them conform to POSIX 
behavior.  They were using a leading '-' in optstring, which is a GNU extension 
and probably only works on Linux.

I've developed a FreeBSD port (very much like an RPM) and will be developing a 
pkgsrc package for use on CentOS, NetBSD, OS X, and possibly other platforms.

Note that we have not extensively tested the attached patches yet.  That's 
going to take some time and I wanted to make you aware of them ASAP.  I have 
confirmed that they eliminate all critical errors in "make check".  I few 
errors are reported, but they're due to minor differences in the output such as 
-Nan vs NaN.

Regards,

    Jason
    jwbacon@tds.net

Original issue reported on code.google.com by bacon4...@gmail.com on 15 Feb 2015 at 5:28

GoogleCodeExporter commented 8 years ago

Updated patch files that also work on Linux.

Linux getopt() doesn't conform to POSIX behavior unless explicitly told to.  
The updated patches set the POSIXLY_CORRECT environment variable (and remove 
one leading '-' from optstring that was left in the last patch set).

There is still one failure with fastq-multx I haven't figured out.  The results 
are correct, but the file names are missing from the output.  I'll keep working 
on it and send another update when it's resolved.

Original comment by bacon4...@gmail.com on 17 Feb 2015 at 3:02

Attachments: