Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings during building under Win32 #1176

Closed
asl opened this issue Jun 8, 2006 · 3 comments
Closed

Warnings during building under Win32 #1176

asl opened this issue Jun 8, 2006 · 3 comments
Labels
bugzilla Issues migrated from bugzilla code-cleanup

Comments

@asl
Copy link
Collaborator

asl commented Jun 8, 2006

Bugzilla Link 804
Resolution FIXED
Resolved on Feb 22, 2010 12:53
Version trunk
OS Windows 2000

Extended Description

I'm constantly get the folowing warnings during build:

In file included from f:/tmp/llvm/build/../src/lib/System/Path.cpp:107:
f:/tmp/llvm/build/../src/lib/System/Win32/Path.inc: In static member function
static llvm::sys::Path llvm::sys::Path::GetTemporaryDirectory()': f:/tmp/llvm/build/../src/lib/System/Win32/Path.inc:124: warning: unsigned int format, DWORD arg (arg 3) f:/tmp/llvm/build/../src/lib/System/Win32/Path.inc: In member function void
llvm::sys::Path::getStatusInfo(llvm::sys::Path::StatusInfo&) const':
f:/tmp/llvm/build/../src/lib/System/Win32/Path.inc:343: warning: left shift
count >= width of type

Today I've decided to look inside.

The first warning fixes easily just by casting DWORD to unsigned.
The second is much more hm...

Win32/Path.inc:343:
info.fileSize = fi.nFileSizeHigh;
info.fileSize <<= 32;
info.fileSize += fi.nFileSizeLow;

info is StatusInfo, so fileSize is size_t, which is 32 bits here.

The main question: should this get fixed somehow or not?

@llvmbot
Copy link
Collaborator

llvmbot commented Jun 8, 2006

@asl
Copy link
Collaborator Author

asl commented Jun 8, 2006

Yes. That fixed the warning.

One more additional patch (GetCurrentProcessId() is DWORD, which is signed):

--- lib/System/Win32/Path.inc 46db45fba9a284264f13eb41377ba92c8a6210ca
+++ lib/System/Win32/Path.inc ab3912c28f2fce713574f5f4c6248ac808bde8dc
@@ -121,7 +121,7 @@

// Append a subdirectory passed on our process id so multiple LLVMs don't
// step on each other's toes.

  • sprintf(pathname, "LLVM_%u", GetCurrentProcessId());
  • sprintf(pathname, "LLVM_%u", (unsigned)GetCurrentProcessId());
    result.appendComponent(pathname);

    // If there's a directory left over from a previous LLVM execution that

@llvmbot
Copy link
Collaborator

llvmbot commented Jun 8, 2006

Committed here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20060605/035469.html

Resolving this as fixed. Please re-open if there are more issues.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla code-cleanup
Projects
None yet
Development

No branches or pull requests

2 participants