summaryrefslogtreecommitdiff
path: root/soltools
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-08-30 10:29:16 +0300
committerTor Lillqvist <tml@iki.fi>2013-08-30 10:30:04 +0300
commit803b669ec4c1a1052c0ea129fc7e689005e0dddf (patch)
tree1ff66d1e491f1423aa510ce50e5e881a91103a21 /soltools
parent13ac0631d3bba56220e75f3c416d753201fd09a8 (diff)
WaE: size_t/unsigned int: possible loss of data
With MSVC, the third parameter to read() is unsigned int. Change-Id: I607089fb2a9e6bf794293187be48e910ac40158f
Diffstat (limited to 'soltools')
-rw-r--r--soltools/mkdepend/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c
index 149bae1e62da..b636498fc7e3 100644
--- a/soltools/mkdepend/main.c
+++ b/soltools/mkdepend/main.c
@@ -482,7 +482,7 @@ struct filepointer *getfile(file)
struct stat st;
off_t size_backup;
ssize_t bytes_read;
- size_t malloc_size;
+ unsigned malloc_size;
content = (struct filepointer *)malloc(sizeof(struct filepointer));
if ((fd = open(file, O_RDONLY)) < 0) {
@@ -495,13 +495,13 @@ struct filepointer *getfile(file)
size_backup = st.st_size;
malloc_size = size_backup;
- /* Since off_t is larger than size_t, need to test for
+ /* Since off_t usually is larger than unsigned, need to test for
* truncation.
*/
if ( (off_t)malloc_size != size_backup )
{
close( fd );
- warning("makedepend: File \"%s\" size larger than can fit in size_t. Cannot allocate memory for contents.\n", file);
+ warning("makedepend: File \"%s\" is too large.\n", file);
content->f_p = content->f_base = content->f_end = (char *)malloc(1);
*content->f_p = '\0';
return(content);