0

I'm trying to remove around 400 warnings like "C4503: decorated name length exceeded, name was truncated ..." from a huge project.

As this question states, there's no easy way to figure out from where these warnings are coming from, besides there will be in a lot of different translation units. In order to remove them I would like to do it through the Visual Studio project settings (I use VS 2013).

Is it possible? How can I do it?

Community
  • 1
  • 1
FrankS101
  • 2,112
  • 6
  • 26
  • 40
  • 1
    http://stackoverflow.com/questions/178532/how-do-i-increase-the-allowed-decorated-name-length-in-vc9-msvc-2008 . VC doesn't allow you to increase the length limit AFAIK so you're going to have find the offending code. Note that if somehow the names still differ then you can safely ignore these warnings since the linker can still pick the correct one. The problem gets harder when ambiguity comes into play the moment the names are truncated. – Hatted Rooster Nov 21 '16 at 14:25
  • 1
    If your code links despite the warning (that's a big IF), then https://msdn.microsoft.com/en-us/library/jj715718.aspx will show you how to disable C4503 – Martin Bonner supports Monica Nov 21 '16 at 14:29
  • @MartinBonner Thanks! That's the link I was looking for. – FrankS101 Nov 21 '16 at 14:47
  • 1
    @aspen100: A good answer to that question would be very welcome - but I suspect it would be off-topic for Stack Overflow! – Martin Bonner supports Monica Nov 21 '16 at 15:27

1 Answers1

1

It can be done in two different ways:

  1. Project properties -> C++ -> Advanced -> Disable specific warnings -> Add 4503.
  2. Disable the compiler warning by /wd4503
FrankS101
  • 2,112
  • 6
  • 26
  • 40