Indent breaks hex float literals

Moshe Benezra <[email protected]> Sun, 15 Mar 2015 04:56:56 -0400
Newsgroups gmane.comp.gnu.indent.bugs
Message-ID <CAA7paE__JgVroZ16+nqD7k9-T--v4twC7Y9KLdv6x8gEyHjvXw@mail.gmail.com>
Hello,
(I couldn’t find reference to this problem in the archive or on line) :

C can recognize float in hex float literals, for example:

#include <stdio.h>
double    pi = 0x1.921fb54442d18p+1;
int main()
{
    printf("%17.15lf\n", pi);
    return 0;
}

However, when gnu-indent is applied to this program it replaces the hex
float with:

double    pi = 0x1 .921 fb54442d18p + 1;

which results with a compilation error (clang):

pi1.c:3:17: error: expected ';' after top level declarator
double          pi = 0x1 .921 fb54442d18p + 1;

It is possible, of course, to disable indent for  line containing hex float
literals
but that would clutter the source.

I greatly appreciate your help,

Sincerely,

--Moshe Ben-Ezra
_______________________________________________
bug-indent mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-indent