This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug report. Clang sqrtl(-1) causes access violation


Agner Fog, on Friday, May 10, 2019 08:57 AM, wrote...
>
>Bug description:
>
>The sqrtl function under Clang causes an access violation when the
>argument is negative.
>
>This error occurs only under Cygwin.
>
>This error occurs only with the sqrtl function, not with sqrt or sqrtf
>
It works for me.

e608313@HOR711318E /cygdrive/c/source/c++/cygwin
$ clang sqrt.cpp

e608313@HOR711318E /cygdrive/c/source/c++/cygwin
$ ls
a.exe  a.exe.stackdump  ATT00001.txt  cygcheck.out  sqrt.cpp

e608313@HOR711318E /cygdrive/c/source/c++/cygwin
$ ./a.exe
-1.000000

e608313@HOR711318E /cygdrive/c/source/c++/cygwin
$ uname -a
CYGWIN_NT-6.1 HOR711318E 3.0.7(0.338/5/3) 2019-04-30 18:04 i686 Cygwin

e608313@HOR711318E /cygdrive/c/source/c++/cygwin
$ clang --version
clang version 5.0.1 (tags/RELEASE_501/final)
Target: i686-pc-windows-cygnus
Thread model: posix
InstalledDir: /usr/bin

e608313@HOR711318E /cygdrive/c/source/c++/cygwin
$ cat sqrt.cpp


#include <stdio.h>
#include <math.h>
float a = -1.f;

int main() {
    float b = sqrtl(a);
    printf("%f\n", b);
    return 0;
}





--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]