[Bug c/69088] type conversion to int
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69088 --- Comment #2 from BENAÏSSA --- /* thank you for your answer. A.Benaïssa Comment: Please consider this case: */ #include int main() { float A = 0.F ; _Bool B1 = 1.F / A ; signed char B2 = 1.F / A ; unsigned char B3 = 1.F / A ; signed short B4 = 1.F / A ; unsigned short B5 = 1.F / A ; signed int B6 = 1.F / A ; unsigned int B7 = 1.F / A ; signed long B8 = 1.F / A ; unsigned long B9 = 1.F / A ; signed long long B10 = 1.F / A ; unsigned long long B11 = 1.F / A ; double C = 0. ; _Bool D1 = 1. / C ; signed char D2 = 1. / C ; unsigned char D3 = 1. / C ; signed short D4 = 1. / C ; unsigned short D5 = 1. / C ; signed int D6 = 1. / C ; unsigned int D7 = 1. / C ; signed long D8 = 1. / C ; unsigned long D9 = 1. / C ; signed long long D10 = 1. / C ; unsigned long long D11 = 1. / C ; long double E = 0.L ; _Bool F1 = 1.L / E ; signed char F2 = 1.L / E ; unsigned char F3 = 1.L / E ; signed short F4 = 1.L / E ; unsigned short F5 = 1.L / E ; signed int F6 = 1.L / E ; unsigned int F7 = 1.L / E ; signed long F8 = 1.L / E ; unsigned long F9 = 1.L / E ; signed long long F10 = 1.L / E ; unsigned long long F11 = 1.L / E ; __float128 G = 0.Q ; _Bool H1 = 1.Q / G ; signed char H2 = 1.Q / G ; unsigned char H3 = 1.Q / G ; signed short H4 = 1.Q / G ; unsigned short H5 = 1.Q / G ; signed int H6 = 1.Q / G ; unsigned int H7 = 1.Q / G ; signed long H8 = 1.Q / G ; unsigned long H9 = 1.Q / G ; signed long long H10 = 1.Q / G ; unsigned long long H11 = 1.Q / G ; printf("_Bool\n") ; printf(" B1 = %d \n" , B1) ; printf(" D1 = %d \n" , D1) ; printf(" F1 = %d \n" , F1) ; printf(" H1 = %d \n" , H1) ; printf("char signed\n") ; printf(" B2 = %d \n" , (int)B2) ; printf(" D2 = %d \n" , (int)D2) ; printf(" F2 = %d \n" , (int)F2) ; printf(" H2 = %d \n" , (int)H2) ; printf("char unsigned\n") ; printf(" B3 = %u \n" , (int unsigned)B3) ; printf(" D3 = %u \n" , (int unsigned)D3) ; printf(" F3 = %u \n" , (int unsigned)F3) ; printf(" H3 = %u \n" , (int unsigned)H3) ; printf("short signed\n") ; printf(" B4 = %hd \n" , B4) ; printf(" D4 = %hd \n" , D4) ; printf(" F4 = %hd \n" , F4) ; printf(" H4 = %hd \n" , H4) ; printf("short unsigned\n") ; printf(" B5 = %hu \n" , B5) ; printf(" D5 = %hu \n" , D5) ; printf(" F5 = %hu \n" , F5) ; printf(" H5 = %hu \n" , H5) ; printf("int signed\n") ; printf(" B6 = %d \n" , B6) ; printf(" D6 = %d \n" , D6) ; printf(" F6 = %d \n" , F6) ; printf(" H6 = %d \n" , H6) ; printf("int unsigned\n") ; printf(" B7 = %u \n" , B7) ; printf(" D7 = %u \n" , D7) ; printf(" F7 = %u \n" , F7) ; printf(" H7 = %u \n" , H7) ; printf("long\n") ; printf(" B8 = %d \n" , B8) ; printf(" D8 = %d \n" , D8) ; printf(" F8 = %d \n" , F8) ; printf(" H8 = %d \n" , H8) ; printf("long unsigned \n") ; printf(" B9 = %lu \n" , B9) ; printf(" D9 = %lu \n" , D9) ; printf(" F9 = %lu \n" , F9) ; printf(" H9 = %lu \n" , H9) ; printf("long long \n") ; printf(" B10 = %lld \n" , B10) ; printf(" D10 = %lld \n" , D10) ; printf(" F10 = %lld \n" , F10) ; printf(" H10 = %lld \n" , H10) ; printf("long long unsigned\n") ; printf(" B11 = %llu \n" , B11) ; printf(" D11 = %llu \n" , D11) ; printf(" F11 = %llu \n" , F11) ; printf(" H11 = %llu \n" , H11) ; return 0; } /* RESULTS:: _Bool B1 = 1 D1 = 1 F1 = 1 H1 = 1 char signed B2 = 0 D2 = 0 F2 = 0 H2 = -1 char unsigned B3 = 0 D3 = 0 F3 = 0 H3 = 0 short signed B4 = -32768 D4 = -32768 F4 = -32768 H4 = -1 short unsigned B5 = 0 D5 = 0 F5 = 0 H5 = 0 int signed B6 = -2147483648 D6 = -2147483648 F6 = -2147483648 H6 = 2147483647 int unsigned B7 = 0 D7 = 0 F7 = 0 H7 = 0 long B8 = -2147483648 D8 = -2147483648 F8 = -2147483648 H8 = 2147483647 long unsigned B9 = 0 D9 = 0 F9 = 0 H9 = 0 long long B10 = -9223372036854775808 D10 = -9223372036854775808 F10 = -9223372036854775808 H10 = 9223372036854775807 long long unsigned B11 = 0 D11 = 0 F11 = 0 H11 = 0 it is clear that there is no real infinite value for any floating point representation but instead there is a symbolic representation of infinites values by a finite sequence of bits. This finite sequence of bits allows us to create a simple algebra on infinite's. The type conversion from valid floating values to integer values is always possible in C. This not means that for "infinites floating point values" , the result of type
[Bug c/69086] crealf may be invalid value
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69086 --- Comment #2 from BENAÏSSA --- thank you for your clear answer.comment: And I imagine that it is not possible to define in C the complex value (inf,inf). A.Benaïssa Le Mercredi 30 décembre 2015 21h14, pinskia at gcc dot gnu.orga écrit : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69086 Andrew Pinski changed: What |Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Andrew Pinski --- A1_1 = 1.0e+0 / 0.0; A2_2 = 1.0e+0 / 0.0; A2.0_3 = A2_2; _4 = A2.0_3 * 0.0; _5 = _4 + A1_1; A3_6 = COMPLEX_EXPR <_5, A2.0_3>; _7 = (double) A1_1; printf ("%f\n", _7); _10 = REALPART_EXPR ; _11 = (double) _10; printf ("%f\n", _11); _13 = (double) A2_2; printf ("%f\n", _13); _15 = IMAGPART_EXPR ; _16 = (double) _15; printf ("%f\n", _16); _18 = 0; The reason is more complex than what you think. Sorry for the pun. But since there is no imagine type A2*1.Fi is really A2*(0 + 1Fi) So for the real part you get: A1 + A2 * 0 A2 * 0 is nan as inf * 0 is a nan.
[Bug c/69086] New: crealf may be invalid value
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69086 Bug ID: 69086 Summary: crealf may be invalid value Product: gcc Version: 4.8.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: ka_bena at yahoo dot fr Target Milestone: --- # include # include # include int main( void) { float A1 = 1.f/0.f ; float A2 = 1.f/0.f ; _Complex float A3 = A1 + A2*1.Fi ; printf("%f\n",A1); printf("%f\n",crealf(A3)); printf("%f\n",A2); printf("%f\n",cimagf(A3)); return 0 ; } /* RESULTS:: inf -nan inf inf gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) gcc -std=gnu99 -Wall -Wextra -omain_crealf.exe main_crealf.c ; */
[Bug c/69088] New: type conversion to int
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69088 Bug ID: 69088 Summary: type conversion to int Product: gcc Version: 4.8.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: ka_bena at yahoo dot fr Target Milestone: --- #include int main() { float B = 0.F ; int A = 1.F / B ; __float128 B1 = 0.Q ; intA1 = 1.Q / B1 ; printf("A = %d\n", A ); printf("A1 = %d\n", A1); return 0; } /* RESULTS:: A = -2147483648 A1 = 2147483647 gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) gcc -std=gnu99 -Wall -Wextra -omain_conversion.exe main_conversion.c ; */
[Bug c/67930] segmentation fault
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67930 --- Comment #2 from BENAÏSSA --- Thank you for your reply. Comments:: I am not convinced by your point of view. 1- the compilation step does not deliver any message. 2- I modify the string by address and this is permitted by C for any entity not private in its context. 3- if the compiler gcc allows segmentation fault for basic operations on pointers, I think that this is a severe bug and in consequence the compiler must be modified to remedie for such situations. This is my point of view. A.Benaïssa Le Lundi 12 octobre 2015 13h16, mpolacek at gcc dot gnu.orga écrit : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67930 Marek Polacek changed: What |Removed |Added Status|UNCONFIRMED |RESOLVED CC| |mpolacek at gcc dot gnu.org Resolution|--- |INVALID --- Comment #1 from Marek Polacek --- You're trying to modify a string literal. That's no-no.
[Bug c/67930] New: segmentation fault
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67930 Bug ID: 67930 Summary: segmentation fault Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: ka_bena at yahoo dot fr Target Milestone: --- # include # include void test ( char **A ) { *A[0] = 'a' ; } int main( void) { char *b = "omega" ; test ( ) ; printf ( "b = %s \n" , b ) ; return 0 ; } /* RESULTS:: Segmentation fault (core dumped) Exited: 35584 gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) gcc -std=gnu99 -omain_pointer.exe main_pointer.c ; */
[Bug c/67840] #define function error
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67840 --- Comment #2 from BENAÏSSA --- THank you for your reply. A.BENAÏSSA Le Dimanche 4 octobre 2015 16h26, pinskia at gcc dot gnu.orga écrit : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67840 Andrew Pinski changed: What |Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Andrew Pinski --- For ?: both sides are converted into a single type which in case is __float128. There is _Generic or the other builtin which does not suffer this issue.
[Bug c/67840] New: #define function error
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67840 Bug ID: 67840 Summary: #define function error Product: gcc Version: 4.8.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: ka_bena at yahoo dot fr Target Milestone: --- /* #define function error */ #include #include #include #define tadjib(x) (sizeof( x )== sizeof( float ) ?cosf(x) \ :sizeof( x )== sizeof( double ) ?cos(x) \ :sizeof( x ) == sizeof( long double )?cosl(x) \ :cosq(x)) int main(void) { float x = tadjib(1.F) ; double y = tadjib(1. ) ; long double z = tadjib(1.L) ; printf("%E \n" , x ) ; printf("%E \n" , y ) ; printf("%LE \n" , z ) ; printf("\n"); float x1 = 1.F ; double y1 = 1. ; long double z1 = 1.L ; printf ( "%E \n" , tadjib(x1) ) ; printf ( "%E \n" , tadjib(y1) ) ; printf ( "%LE \n" , tadjib(z1) ) ; return 0 ; } /* main_test_generic.c: In function ‘main’: main_test_generic.c:29:4: warning: format ‘%E’ expects argument of type ‘double’, but argument 2 has type ‘__float128’ [-Wformat=] printf ( "%E \n" , tadjib(x1) ) ; ^ main_test_generic.c:30:4: warning: format ‘%E’ expects argument of type ‘double’, but argument 2 has type ‘__float128’ [-Wformat=] printf ( "%E \n" , tadjib(y1) ) ; ^ main_test_generic.c:31:4: warning: format ‘%LE’ expects argument of type ‘long double’, but argument 2 has type ‘__float128’ [-Wformat=] printf ( "%LE \n" , tadjib(z1) ) ; ^ Done.*/ /* Results:: main_test_generic.exe 5.403023E-01 5.403023E-01 5.403023E-01 -5.610234E-259 5.403023E-01 5.403023E-01 gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) gcc -std=gnu99 -omain_test_generic.exe main_test_generic.c -lm -lquadmath ; */
[Bug c/67668] erroneous type argument for unary operator one's complement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67668 --- Comment #4 from BENAÏSSA --- Thank you for your quick and clear reply . Note: I think that using the same symbol operator for doing two different things can be a potential source of blind errors. I confirm that this is only a personnal point of view. A.Benaïssa Le Lundi 21 septembre 2015 15h41, manu at gcc dot gnu.orga écrit : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67668 Manuel López-Ibáñez changed: What |Removed |Added Status|UNCONFIRMED |RESOLVED CC| |manu at gcc dot gnu.org Resolution|--- |INVALID --- Comment #3 from Manuel López-Ibáñez --- Marc is right: The operator ‘~’ performs complex conjugation when used on a value with a complex type. This is a GNU extension; for values of floating type, you should use the ISO C99 functions conjf, conj and conjl, declared in and also provided as built-in functions by GCC. test.c:3:3: warning: ISO C does not support ‘~’ for complex conjugation [-Wpedantic] ~( 1. + 0.i ) ; ^
[Bug c/67667] erroneous type argument for unary operator one's complement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67667 --- Comment #2 from BENAÏSSA --- Thank you for your quick and clear reply . Note: I think that using the same symbol operato as GNU extension for doing two different things can be a potential source of blind errors . I confirm that this is only a personnal point of view. A.Benaïssa Le Lundi 21 septembre 2015 13h29, redi at gcc dot gnu.orga écrit : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67667 Jonathan Wakely changed: What |Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |DUPLICATE --- Comment #1 from Jonathan Wakely --- . *** This bug has been marked as a duplicate of bug 67668 ***
[Bug c/67667] New: erroneous type argument for unary operator one's complement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67667 Bug ID: 67667 Summary: erroneous type argument for unary operator one's complement Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: ka_bena at yahoo dot fr Target Milestone: ---
[Bug c/67668] New: erroneous type argument for unary operator one's complement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67668 Bug ID: 67668 Summary: erroneous type argument for unary operator one's complement Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: ka_bena at yahoo dot fr Target Milestone: --- int main(void) { ~( 1. + 0.i ) ; ~(1.) ; return 0 ; } /* Results:: main_cmp1_err.c:4:3: attention : statement with no effect [-Wunused-value] ~( 1. + 0.i ) ; ^ main_cmp1_err.c:5:3: erreur: type d'argument erroné pour un complément de bit ~(1.) ; ^ Comment:: ( 1. + 0.i ) must be an erroneous type argument for ~ . Microsoft Windows XP Profesional version2002 Service Pack 3. Gcc 4.8.0 win32 mingw32 */
[Bug c/67570] comparison rules fails
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67570 --- Comment #4 from BENAÏSSA --- Thank you very much for your reply. Please do not take care of the first set of values for MIN_NORMALIZED and in place you can test those new values. MIN_NORMALIZED 1.755494 E-038 for float 2.225074 E-308 for double 3.362103 E-4932 for __float128 All remainded values stays unchanged. Addendum to precedent note: the proposal is valid for any floating point operation between two float or more with final result lower than (float)MIN_DENORMALIZED, and I will consult the C99/C11 standards and bug 323. I apologize by advance. A.Benaïssa Le Mercredi 16 septembre 2015 16h45, joseph at codesourcery dot coma écrit : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67570 --- Comment #3 from joseph at codesourcery dot com --- I advise looking at __FLT_MAX__, __FLT_MIN__, __FLT_DENORM_MIN__ etc. as predefined by the compiler to see the appropriate values of various constants. > Multiplying (float)MIN_NORMALIZED * (float)MIN_NORMALIZED and > viewing this value with printf("%E..) we obtains > result = 3.109021E-076 wuich is a valid double normalized value. That's a matter of excess range and precision. See the C99/C11 standards and bug 323.
[Bug c/67570] comparison rules fails
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67570 --- Comment #2 from BENAÏSSA --- Thank you for your reply. A.BENAÏSSA Post scriptum: Please can you confirm if you have time that the following positive floating point values are correct. -- MIN_DENORMALIZED 1.401298 E-0045 for float 4.940656 E-0324 for double 3.645200 E-4951 for long double 6.475175 E-4966 for __float128 -- HUGE_DENORMALIZED 1.175494 E-0038 for float 2.225074 E-0308 for double 6.724206 E-4932 for long double 3.362103 E-4932 for __float128 -- MIN_NORMALIZED 1.763242 E-0038 for float 3.337611 E-0308 for double 3.362103 E-4932 for long double 5.043155 E-4932 for __float128 -- HUGE_NORMALIZED 3.402823 E+0038 for float 1.797693 E+0308 for double 1.189731 E+4932 for long double 1.189731 E+4932 for __float128 -- Note: Multiplying (float)MIN_NORMALIZED * (float)MIN_NORMALIZED and viewing this value with printf("%E..) we obtains result = 3.109021E-076 wuich is a valid double normalized value. The float binary representation of result is: 0 000 and this is correct because result is lower than (float)MIN_DENORMALIZED. For coherency because: 1- (float) * (float) = (float) 2- sizeof( (float)MIN_NORMALIZED * (float)MIN_NORMALIZED) ) = 4 the result of printf("%E\n" , (float)MIN_NORMALIZED * (float)MIN_NORMALIZED) ); I suppose must be 0.E0F. Le Lundi 14 septembre 2015 18h52, joseph at codesourcery dot coma écrit : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67570 --- Comment #1 from joseph at codesourcery dot com --- If I understand what you are doing correctly, this is an unnormal representation (exponent not zero or maximal, explicit MSB of mantissa zero). Such representations, which cannot be produced by floating-point operations, are considered trap representations in C terms (undefined behavior if used, no consistency expected or required). Valid representations must have that MSB set for nonzero exponents and clear for zero exponents.
[Bug c/67569] wrong type in error message
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67569 --- Comment #4 from BENAÏSSA --- Thank you for your replty. A.Benaïssa Le Lundi 14 septembre 2015 11h22, mpolacek at gcc dot gnu.orga écrit : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67569 Marek Polacek changed: What |Removed |Added Status|UNCONFIRMED |RESOLVED CC| |mpolacek at gcc dot gnu.org Resolution|--- |WORKSFORME --- Comment #1 from Marek Polacek --- Can't reproduce: h1.c: In function ‘main’: h1.c:5:6: error: invalid operands to binary - (have ‘int *’ and ‘float’) Also, gcc 4.8 is not supported anymore.
[Bug c/67569] wrong type in error message
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67569 --- Comment #5 from BENAÏSSA --- Thank you. A.Benaïssa Le Lundi 14 septembre 2015 13h27, pinskia at gcc dot gnu.orga écrit : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67569 Andrew Pinski changed: What |Removed |Added Status|RESOLVED |UNCONFIRMED Resolution|WORKSFORME |--- --- Comment #2 from Andrew Pinski --- Actually this might be reproducible with -m32 on x86_64. The issue is related to the fix for exessive precision.
[Bug c/67569] New: erroneous compiler error message
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67569 Bug ID: 67569 Summary: erroneous compiler error message Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: ka_bena at yahoo dot fr Target Milestone: --- /* Erroneous compiler error message */ int main(void) { int *A = (int *)533 ; float F = 1.F; A - F ; return 0 ; } /* Results: In function 'main': main_comp_err_msg.c:6:5: erreur: invalid operands to binary - (have 'int *' and 'long double') A-F; ^ Note: The variable F is not of type long double. Microsoft Windows XP Profesional version2002 Service Pack 3. Gcc 4.8.0 win32 mingw32 -std=C99 */
[Bug c/67570] New: comparison rules fails
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67570 Bug ID: 67570 Summary: comparison rules fails Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: ka_bena at yahoo dot fr Target Milestone: --- #include int main(void) { int pos; int pos1 ; int pos2 ; long double A= 0.L ; union { long double X ; char unsigned mask[sizeof(A)] ; } alfa ; alfa.X = A; pos= 32 ; pos1 = 11 - ( pos - 1 ) / 8 ; pos2 = 8; alfa.mask[pos1] =((char unsigned )1 << (sizeof(char unsigned) * 8 - pos2)) ^ alfa.mask[pos1] ; printf ( " [alfa.X]= %LE \n" , alfa.X) ; printf ( " [alfa.X == 0.L] = %i \n" , alfa.X == 0.L ) ; printf ( " [alfa.X != 0.L] = %i \n" , alfa.X != 0.L ) ; printf ( " [alfa.X <= 0.L] = %i \n" , alfa.X <= 0.L ) ; printf ( " [alfa.X >= 0.L] = %i \n" , alfa.X >= 0.L ) ; printf ( " [alfa.X < 0.L] = %i \n" , alfa.X < 0.L ) ; printf ( " [alfa.X > 0.L] = %i \n" , alfa.X > 0.L ) ; return 0 ; } /* Results: [alfa.X]= 0.00E+000 [alfa.X == 0.L] = 0 [alfa.X != 0.L] = 1 [alfa.X <= 0.L] = 0 [alfa.X >= 0.L] = 0 [alfa.X < 0.L] = 0 [alfa.X > 0.L] = 0 Note: Binary representation IEEE 754 of alfa.X is: 0 001 It seems that comparison rules fails in this case. Microsoft Windows XP Profesional version2002 Service Pack 3. Gcc 4.8.0 win32 mingw32 -std=C99 */
[Bug c/67547] may be an error in printf(%a..) for nexttowardf(0.f,1.f)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67547 --- Comment #2 from BENAÏSSA --- Thank you very much for your reply. A.Benaïssa Le Vendredi 11 septembre 2015 13h25, pinskia at gcc dot gnu.orga écrit : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67547 Andrew Pinski changed: What |Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Andrew Pinski --- Report this to mingw since that is where printf comes from (though it might come directly from Microsoft's libc). Also by the way nexttowardf is C99 and not C89 so I am getting warnings with glibc and C89: t1.c: In function 'main': t1.c:6:20: warning: implicit declaration of function 'nexttowardf' [-Wimplicit-function-declaration] printf(" %E\n", nexttowardf ( 0.F , 1.F ) ) ; ^ t1.c:6:10: warning: format '%E' expects argument of type 'double', but argument 2 has type 'int' [-Wformat=] printf(" %E\n", nexttowardf ( 0.F , 1.F ) ) ; ^ t1.c:7:10: warning: format '%A' expects argument of type 'double', but argument 2 has type 'int' [-Wformat=] printf(" %A\n", nexttowardf ( 0.F , 1.F ) ) ; ^ t1.c:8:20: warning: implicit declaration of function 'nexttoward' [-Wimplicit-function-declaration] printf(" %A\n", nexttoward ( 0. , 1. ) ) ; ^ t1.c:8:10: warning: format '%A' expects argument of type 'double', but argument 2 has type 'int' [-Wformat=] printf(" %A\n", nexttoward ( 0. , 1. ) ) ;
[Bug c/67547] New: may be an error in printf(%a..) for nexttowardf(0.f,1.f)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67547 Bug ID: 67547 Summary: may be an error in printf(%a..) for nexttowardf(0.f,1.f) Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: ka_bena at yahoo dot fr Target Milestone: --- include include int main(void) { printf(" %E\n", nexttowardf ( 0.F , 1.F ) ) ; printf(" %A\n", nexttowardf ( 0.F , 1.F ) ) ; printf(" %A\n", nexttoward ( 0. , 1. ) ) ; return 0 ; } /* Results 1.401298E-045 0X0P-149 0X1P-1023 Comment:: may be an error in printf("%A...) for this value ? Microsoft Windows XP Profesional version2002 Service Pack 3. Gcc 4.8.0 win32 mingw32 std =-C99 */
[Bug c/67095] errno for logf(-1.f)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67095 --- Comment #2 from BENAÏSSA --- Thank you for your reply. A.Benaïssa. Le Dimanche 2 août 2015 13h46, pinskia at gcc dot gnu.orga écrit : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67095 Andrew Pinski changed: What |Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Andrew Pinski --- Not a gcc bug as gcc does not provide logf. Please report it to mingw if you want the optional setting of errno to happen (note this is optional for both c and posix).
[Bug c/67095] New: errno for logf(-1.f)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67095 Bug ID: 67095 Summary: errno for logf(-1.f) Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: ka_bena at yahoo dot fr Target Milestone: --- #include stdlib.h #include stdio.h #include errno.h #include math.h int main(void) { float A = -1.f ; float B = logf(A); printf ( B = %f \n , B) ; printf ( errno = %d \n , errno) ; float C = sqrtf(A); printf ( C = %f \n , C) ; printf ( errno = %d \n , errno) ; return 0; } /* Compilation and linkage */ /* -- Capture Output --*/ /* */ /* E:\PAPA\test_gcc\C99\COMPIL_C\compil_c99.bat*/ /* main_errno_gcc4.8.0 */ /* E:\PAPA\test_gcc\FONCTIONS\FORBA\MAIN_TEST\main_errno_gcc4.8.0.c*/ /* */ /* Utilisation des specs internes. */ /* */ /* COLLECT_GCC=d:\gfortran\bin\gcc.exe */ /* */ /* COLLECT_LTO_WRAPPER=*/ /* d:/gfortran/bin/../libexec/gcc/mingw32/4.8.0/lto-wrapper.exe*/ /* */ /* Target: mingw32 */ /* */ /* Configuré avec: */ /* ../gcc-trunk/configure --prefix=/mingw --enable-languages=c , */ /* fortran,lto --with-gmp=/home/brad/gfortran/dependencies*/ /* --disable-werror --enable-threads --enable-nls */ /* --build=i586-pc-mingw32 --enable-libgomp --enable-shared */ /* --disable-win32-registry --with-dwarf2 */ /* --disable-sjlj-exceptions */ /* --enable-lto --build=mingw32 */ /* --enable-version-specific-runtime-libs */ /* */ /* Modèle de thread: win32 */ /* */ /* gcc version 4.8.0 20130302 (experimental) */ /* [trunk revision 196403] */ /* (GCC) */ /* */ /* COLLECT_GCC_OPTIONS='-v' '-std=c99' '-Warray-bounds' '-Wall'*/ /* '-Wextra' '-Waddress' '-Wbad-function-cast' '-Wformat=1' */ /* '-Wformat-contains-nul' '-Wformat-extra-args' */ /* '-Wformat-nonliteral' */ /* '-Wformat-security' '-Wformat-zero-length' */ /* '-Wsuggest-attribute=format' '-Woverlength-strings'*/ /* '-malign-stringops'*/ /* '-o' 'E:\PAPA\test_gcc\EXE\main_errno_gcc4.8.0_C99.exe'*/ /* '-mtune=i386' '-march=i386'*/ /* d:/gfortran/bin/../libexec/gcc/mingw32/4.8.0/cc1.exe */ /* -quiet -v -iprefix d:\gfortran\bin\../lib/gcc/mingw32/4.8.0/ */ /* E:\PAPA\test_gcc\FONCTIONS\FORBA\MAIN_TEST\*/ /* main_errno_gcc4.8.0.c */ /* -quiet -dumpbase main_errno_gcc4.8.0.c -malign-stringops */ /* -mtune=i386 -march=i386 -auxbase main_errno_gcc4.8.0 */ /* -Warray-bounds -Wall -Wextra -Waddress -Wbad-function-cast */ /* -Wformat=1 -Wformat-contains-nul -Wformat-extra-args */ /* -Wformat-nonliteral -Wformat-security */ /* -Wformat-zero-length -Wsuggest-attribute=format*/ /* -Woverlength-strings -std=c99 -version */ /* -o C:\DOCUME~1\Jupiter\LOCALS~1\Temp\ccHKpeRr.s*/ /* */ /* GNU C (GCC) version 4.8.0 20130302 (experimental) */ /* [trunk revision 196403] (mingw32) */ /* */ /* compiled by GNU C version 4.8.0 20130302 (experimental)*/ /* [trunk revision 196403], GMP version 5.0.2, MPFR version 3.1.0,*/ /* MPC version 0.9
[Bug c/66613] error in evaluationg cexp
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66613 --- Comment #5 from BENAÏSSA ka_bena at yahoo dot fr --- Thank you for your mail.I do not know where is the error but after execution I do not have the good result. anyway! Compile Flags: -std=c99 -Warray-bounds -Wall -Wextra -Waddress -Wbad-function-cast -Wformat -Wformat-contains-nul -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-zero-length -Wmissing-format-attribute -Woverlength-strings -foptional-diags -Woverlength-strings -malign-stringops -malign-stringops -lm -llquadmath I work with windowsXP on Compaq 6720S. I use gcc provided by gfortran. I hope that those informations can be useful. thank you A.BENAISSA Le Dimanche 21 juin 2015 12h37, michael.l...@uni-ulm.de gcc-bugzi...@gcc.gnu.org a écrit : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66613 Michael Lehn michael.l...@uni-ulm.de changed: What |Removed |Added CC| |michael.l...@uni-ulm.de --- Comment #1 from Michael Lehn michael.l...@uni-ulm.de --- // Terminated with exit code 0. So were is the error?
[Bug c/66613] error in evaluationg cexp
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66613 --- Comment #4 from BENAÏSSA ka_bena at yahoo dot fr --- Thank you for your mail. Compile Flags: -std=c99 -Warray-bounds -Wall -Wextra -Waddress -Wbad-function-cast -Wformat -Wformat-contains-nul -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-zero-length -Wmissing-format-attribute -Woverlength-strings -foptional-diags -Woverlength-strings -malign-stringops-malign-stringops-lm-llquadmath I work with windowsXP on Compaq 6720S. I use gcc provided by gfortran.I hope that those informations can be useful. Thank you A.BENAISSA. Le Lundi 22 juin 2015 11h50, rguenth at gcc dot gnu.org gcc-bugzi...@gcc.gnu.org a écrit : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66613 Richard Biener rguenth at gcc dot gnu.org changed: What |Removed |Added Status|UNCONFIRMED |WAITING Last reconfirmed| |2015-06-22 Ever confirmed|0 |1 --- Comment #3 from Richard Biener rguenth at gcc dot gnu.org --- The issue could also be in gmp/mpfr/mpc or in the C library. How did you compile (with what flags) anyway?
[Bug c/66613] New: error in evaluationg cexp
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66613 Bug ID: 66613 Summary: error in evaluationg cexp Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: ka_bena at yahoo dot fr Target Milestone: --- #include stdio.h #include complex.h #include quadmath.h int main(void) { printf( \n); printf(/**/\n); printf( \n); printf( SECTION 1 \n); printf( \n); printf( _Complex float zF = 1.F + 2.Fi ;\n); _Complex float zF = 1.F + 2.Fi ; printf( crealf(cexpf(zF)) = %f \n , crealf(cexpf(zF))) ; printf( cimagf(cexpf(zF)) = %f \n , cimagf(cexpf(zF))) ; printf( \n); printf( _Complex double zD = 1.D + 2.Di ;\n); _Complex double zD = 1.D + 2.Di ; printf( creal(cexp(zD))= %E \n , creal(cexp(zD))) ; printf( cimag(cexp(zD))= %E \n , cimag(cexp(zD))) ; printf( creal(cexp(1.D + 2.Di))= %f \n , creal(cexp(1.D + 2.Di))) ; printf( cimag(cexp(1.D + 2.Di))= %f \n , cimag(cexp(1.D + 2.Di))) ; printf( \n); printf( _Complex long double zL= 1.L + 2.Li\n); _Complex long double zL = 1.L + 2.Li ; printf( creall(cexpl(zL)) = %lE \n , creall(cexpl(zL))) ; printf( cimagl(cexpl(zL)) = %lE \n , cimagl(cexpl(zL))) ; printf( creall(cexpl(1.L + 2.Li)) = %lf \n , creall(cexpl(1.L + 2.Li))) ; printf( cimagl(cexpl(1.L + 2.Li)) = %lf \n , cimagl(cexpl(1.L + 2.Li))) ; printf( \n); printf( __complex128 zQ= 1.Q + 2.Qi\n); __complex128 zQ = 1.Q + 2.Qi ; printf( crealq(cexpq(zQ)) = %lf \n , (long double)crealq(cexpq(zQ))) ; printf( cimagq(cexpq(zQ)) = %lf \n , (long double)cimagq(cexpq(zQ))) ; printf( \n); printf(/**/\n); printf( \n); printf( SECTION 2 \n); printf( \n); float alfa = 1.f / 3.f ; printf( alfa = %-100.80f \n , alfa) ; printf( sizeof(alfa))= %u\n , sizeof(alfa)) ; printf( 1.f/3.f = %-100.80f \n , 1.f/3.f) ; printf( sizeof(1.f/3.f)) = %u\n , sizeof(1.f/3.f)) ; printf( \n); printf(/**/\n); printf( \n); return 0; } //-- Capture Output -- // E:\PAPA\test_gcc\C99\RUN_C\run_C99.bat main_error_gcc481 // //D:\gfortran\includeE:\PAPA\test_gcc\exe\main_error_gcc481_C99.exe // ///**/ // //SECTION 1 // // _Complex float zF = 1.F + 2.Fi ; // crealf(cexpf(zF)) = -1.131204 // cimagf(cexpf(zF)) = 2.471727 // // _Complex double zD = 1.D + 2.Di ; // creal(cexp(zD))= -3.730751E-144 // cimag(cexp(zD))= 6.752940E+268 // creal(cexp(1.D + 2.Di))= -1.131204 // cimag(cexp(1.D + 2.Di))= 2.471727 // // _Complex long double zL= 1.L + 2.Li // creall(cexpl(zL)) = -0.00E+000 // cimagl(cexpl(zL)) = 1.291636E+1644 // creall(cexpl(1.L + 2.Li)) = -1.131204 // cimagl(cexpl(1.L + 2.Li)) = 2.471727 // // __complex128 zQ= 1.Q + 2.Qi // crealq(cexpq(zQ)) = -1.131204 // cimagq(cexpq(zQ)) = 2.471727 // ///**/ // //SECTION 2 // // alfa = 0.333432674407958984375000 // sizeof(alfa))= 4 // 1.f/3.f = 0.1482961625624739099293947219848632812500 // sizeof(1.f/3.f)) = 4 // ///**/ // // // Terminated with exit code 0.