messlinger / cnfconv

Canberra CNF to ASCII file conversion
17 stars 12 forks source link

Error in installation #1

Closed GregTheWolfman closed 1 year ago

GregTheWolfman commented 3 years ago

Hello!

I tried to install your program to convert a Canberra .cnf file to a viewable version on my Ubuntu computer, but I received the error below. I simply cloned the repo and deleted the non-linux files (just cnf2txt, cnf2txtall, cnf2txt.c left). I then ran the line "gcc -o cnf2txt cnf2txt.c" and received this error.

cnf2txt.c: In function ‘main’: cnf2txt.c:184:10: warning: too many arguments for format [-Wformat-extra-args] 184 printf("Error reading from file %s:\n", filename, strerror(err) ); ^~~~~~~ cnf2txt.c:319:30: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint32_t’ {aka ‘unsigned int’} [-Wformat=] 319 fprintf( txt, "%d\t%.3f\t%lu\t%g\n", i+1, energy(i+1, A), channels[i], channels[i]/live_time ); ^ ~~~~~
long unsigned int uint32_t {aka unsigned int}
%u

I also received the same error after deleting the repository, freshly cloning the repository, and running the commands in the full directory. Am I doing this right? Any advice would be appreciated!

messlinger commented 3 years ago

Hello Greg, so there a re still people out there using these old Canberra programs.

1 Is a real bug from my side, a forgotten argument in the printf call, so it never printed the actual error message.

2 Seems to be a portability problem (unsigned long may be larger than uint32_t on some platforms).

I fixed both issues. Can you give it another try now?

GregTheWolfman commented 3 years ago

Yes that worked perfectly! I have been attempting to export the data from this program for days now... your code was a real life saver! thank you again!

On Tue, Oct 20, 2020 at 7:06 PM messlinger notifications@github.com wrote:

Hello Greg, so there a re still people out there using these old Canberra programs.

1 https://github.com/messlinger/cnfconv/issues/1 Is a real bug from my

side, a forgotten argument in the printf call, so it never printed the actual error message.

2 Seems to be a portability problem (unsigned long may be larger than

uint32_t on some platforms).

I fixed both issues. Can you give it another try now?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/messlinger/cnfconv/issues/1#issuecomment-713189626, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALEZSUXB4F3SRPKFMQPEI73SLYJYNANCNFSM4SY5PW2A .

-- Thank you Merrick Lavinsky

B.S. Physics & STEM Education Florida Institute of Technology 2020 High Energy Physics