[LLVMbugs] [Bug 14643] New: diagnostic message tweaks
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Dec 18 18:57:46 PST 2012
http://llvm.org/bugs/show_bug.cgi?id=14643
Bug #: 14643
Summary: diagnostic message tweaks
Product: clang
Version: trunk
Platform: PC
OS/Version: FreeBSD
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: M8R-9yw8a5 at mailinator.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Created attachment 9735
--> http://llvm.org/bugs/attachment.cgi?id=9735
source code with bugette descriptions
1. source code (file name: f.c), filled with comments about the bugettes:
static char a_char;
static float a_float;
static char *a_ptr_to_char;
static int *a_ptr_to_int;
typedef char *string;
static string *a_ptr_to_string;
void f(void)
{
// ===== case #1 =====
*a_char; // WRONG, prints: error: indirection requires pointer operand
('int' invalid)
// should print: error: indirection requires pointer operand
('char' invalid)
// ===== case #2 =====
*a_float; // prints: error: indirection requires
pointer operand ('float' invalid)
// recommendation is to print: error: indirection requires
pointer operand ('float' is invalid)
// ===== case #3 =====
int *a = *a_ptr_to_int; // prints: warning: incompatible integer to
pointer conversion initializing 'int *' with an expression of type 'int';
remove *
char *b = *a_ptr_to_char; // prints: warning: incompatible integer to
pointer conversion initializing 'char *' with an expression of type 'char';
remove *
// recommendation is to replace "integer" with
"integral" in all similar cases
}
2. command line:
clang -c f.c
3. output (currently):
f.c:13:2: error: indirection requires pointer operand ('int' invalid)
*a_char; // WRONG, prints: error: indirection requires pointer operand
('int' invalid)
^~~~~~~
f.c:17:2: error: indirection requires pointer operand ('float' invalid)
*a_float; // prints: error: indirection requires
pointer operand ('float' invalid)
^~~~~~~~
f.c:21:7: warning: incompatible integer to pointer conversion initializing 'int
*' with an expression of type 'int'; remove * [-Wint-conversion]
int *a = *a_ptr_to_int; // prints: warning: incompatible integer to
pointer conversion initializing 'int *' with an expression of type 'int';
remove *
^ ~~~~~~~~~~~~~
f.c:22:8: warning: incompatible integer to pointer conversion initializing
'char *' with an expression of type 'char'; remove * [-Wint-conversion]
char *b = *a_ptr_to_char; // prints: warning: incompatible integer to
pointer conversion initializing 'char *' with an expression of type 'char';
remove *
^ ~~~~~~~~~~~~~~
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list