gnuastro-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[task #16114] Print warning where integer overflow happens


From: Siyang He
Subject: [task #16114] Print warning where integer overflow happens
Date: Tue, 2 May 2023 23:06:34 -0400 (EDT)

Follow-up Comment #12, task #16114 (project gnuastro):

Hi Mohammad, I have updated the overflow check per the comments. The code
remains at https://codeberg.org/decaf/gnuastro/src/branch/overflow-check

Overview of changes:
- Error reporting: I switched fprintf() for error().
- Compilation time: I replaced switch statements with the token pasting
operator at three places:
                    1. Determining the appropriate overflow check,
                      2. Determining the output type when printing error 
messages,
                      3. Determining whether to include overflow checking code 
at all. Many
operators, such as ">", never cause overflows, and overflow checks would only
add to compilation time without providing any benefit.
- I also updated doc/gnuastro.texi to include the
GAL_ARITHMETIC_FLAG_OVERFLOW_CHECK flag.

On my machine it takes 5 minutes to compile the master branch, and about 5:30
for the overflow check.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/task/?16114>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]