LukasScheucher / include-what-you-use

Automatically exported from code.google.com/p/include-what-you-use
Other
0 stars 0 forks source link

tells me I need ext/alloc_traits.h but not why #163

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The full include-list for ../hc/hc.cpp:
#include <ctype.h>                      // for isalpha, isdigit
#include <ext/alloc_traits.h>
#include <fcntl.h>                      // for open, O_RDONLY, O_RDWR
#include <stdio.h>                      // for printf, fwrite, fclose, etc
#include <stdlib.h>                     // for atoi, malloc, qsort, exit, etc
#include <string.h>                     // for strlen, strcpy, strcmp, etc
#include <unistd.h>                     // for close, read, lseek, unlink, etc
#include <algorithm>                    // for min
#include <cassert>                      // for assert
#include <cstdarg>                      // for va_list, va_end, va_start
#include <string>                       // for string
#include <vector>                       // for vector
#include "helpcom.h"                    // for PD_INFO, setint, etc
#include "port.h"                       // for BYTE, VOIDPTR, VOIDCONSTPTR
#include "unix.h"                       // for strlwr, O_BINARY, _MAX_EXT, etc

See the source code here:
<https://github.com/LegalizeAdulthood/iterated-dynamics>
changeset 97459e23a88337fd66eb9f0e3739d85102241c55

Original issue reported on code.google.com by legal...@xmission.com on 22 Dec 2014 at 10:54

GoogleCodeExporter commented 8 years ago
Can you run IWYU with maximum verbosity and see if you can see what the basis 
for its decision is?

  $ include-what-you-use ../hc/hc.cpp --Xiwyu --verbose=7 ... the rest of your switches ...

Thanks!

Original comment by kim.gras...@gmail.com on 22 Dec 2014 at 11:18

GoogleCodeExporter commented 8 years ago
Oh, and what platform (OS/compiler/standard library) are you on?

Original comment by kim.gras...@gmail.com on 23 Dec 2014 at 9:43

GoogleCodeExporter commented 8 years ago
This was on Ubuntu 12.10 ... not sure what version of gcc/library I have on 
that machine.  I will update later.

Original comment by legal...@xmission.com on 23 Dec 2014 at 2:32

GoogleCodeExporter commented 8 years ago
$ g++ --version
g++ (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

It appears to think I need ext/alloc_traits.h because of something in the 
standard library.  I have whatever standard library came with this gcc.

Original comment by legal...@xmission.com on 23 Dec 2014 at 5:07

GoogleCodeExporter commented 8 years ago
verbose output

Original comment by legal...@xmission.com on 23 Dec 2014 at 5:08

Attachments:

GoogleCodeExporter commented 8 years ago
I guess there are no symbols for <ext/alloc_traits.h> because of 80 characters 
limit at 
https://code.google.com/p/include-what-you-use/source/browse/trunk/iwyu_output.c
c#1655 And length of

#include <ext/alloc_traits.h>           // for __alloc_traits<>::value_type

is 75.

Another issue is that we shouldn't have suggested to add <ext/alloc_traits.h> 
for private symbol __alloc_traits.

Original comment by vsap...@gmail.com on 25 Dec 2014 at 10:21

GoogleCodeExporter commented 8 years ago
I think I'd rather see symbols truncated with ..., etc. instead of omitted 
entirely in the output.   At least then I'd have some clue why I'm supposed to 
be including this header.

Do you want a separate ticket for the suggestion to include a header to resolve 
an implementation symbol?

Original comment by legal...@xmission.com on 25 Dec 2014 at 10:35

GoogleCodeExporter commented 8 years ago
Makes sense. I think we can allow slightly longer lines when don't add ", 
etc.". And truncating symbol with "..." seems to be better than omitting it.

> Do you want a separate ticket for the suggestion to include a header to 
resolve an implementation symbol?
Yes, please submit a separate ticket.

Original comment by vsap...@gmail.com on 25 Dec 2014 at 11:12

GoogleCodeExporter commented 8 years ago
Extracted bug with ext/alloc_traits.h to issue #166.

Let this bug focus on the formatting.

Original comment by kim.gras...@gmail.com on 3 Jan 2015 at 12:18

GoogleCodeExporter commented 8 years ago

Original comment by kim.gras...@gmail.com on 6 Apr 2015 at 3:16