-
Notifications
You must be signed in to change notification settings - Fork 429
type qualifiers ignored on function return type [-Werror=ignored-qualifiers] #746
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
Comments
@drizt while I do not get this warning, agree it does appear an accidental duplication of the Was just about to merge #767, but noted this should be repeated in This gives a full fix as follows - have I missed any other cases? diff --git a/include/tidy.h b/include/tidy.h
index c701890..7e30216 100644
--- a/include/tidy.h
+++ b/include/tidy.h
@@ -2092,13 +2092,13 @@ TIDY_EXPORT const tidyLocaleMapItem* TIDY_CALL getNextWindowsLanguage( TidyItera
** @param item An instance of tidyLocalMapItem to query.
** @result Returns a string with the Windows name of the mapping.
*/
-TIDY_EXPORT const ctmbstr TIDY_CALL TidyLangWindowsName( const tidyLocaleMapItem *item );
+TIDY_EXPORT ctmbstr TIDY_CALL TidyLangWindowsName( const tidyLocaleMapItem *item );
/** Given a `tidyLocalMapItem`, return the POSIX name.
** @param item An instance of tidyLocalMapItem to query.
** @result Returns a string with the POSIX name of the mapping.
*/
-TIDY_EXPORT const ctmbstr TIDY_CALL TidyLangPosixName( const tidyLocaleMapItem *item );
+TIDY_EXPORT ctmbstr TIDY_CALL TidyLangPosixName( const tidyLocaleMapItem *item );
/** @}
** @name Getting Localized Strings
diff --git a/src/language.c b/src/language.c
index fd89730..3907d9e 100644
--- a/src/language.c
+++ b/src/language.c
@@ -593,7 +593,7 @@ const tidyLocaleMapItemImpl *TY_(getNextWindowsLanguage)( TidyIterator *iter )
/**
* Given a `tidyLocalMapItemImpl, return the Windows name.
*/
-const ctmbstr TY_(TidyLangWindowsName)( const tidyLocaleMapItemImpl *item )
+ctmbstr TY_(TidyLangWindowsName)( const tidyLocaleMapItemImpl *item )
{
return item->winName;
}
@@ -602,7 +602,7 @@ const ctmbstr TY_(TidyLangWindowsName)( const tidyLocaleMapItemImpl *item )
/**
* Given a `tidyLocalMapItemImpl, return the POSIX name.
*/
-const ctmbstr TY_(TidyLangPosixName)( const tidyLocaleMapItemImpl *item )
+ctmbstr TY_(TidyLangPosixName)( const tidyLocaleMapItemImpl *item )
{
return item->POSIXName;
}
diff --git a/src/language.h b/src/language.h
index c8542b5..7ff4d18 100644
--- a/src/language.h
+++ b/src/language.h
@@ -191,12 +191,12 @@ const tidyLocaleMapItemImpl *TY_(getNextWindowsLanguage)( TidyIterator* iter );
/**
* Given a `tidyLocalMapItemImpl, return the Windows name.
*/
-const ctmbstr TY_(TidyLangWindowsName)( const tidyLocaleMapItemImpl *item );
+ctmbstr TY_(TidyLangWindowsName)( const tidyLocaleMapItemImpl *item );
/**
* Given a `tidyLocalMapItemImpl, return the POSIX name.
*/
-const ctmbstr TY_(TidyLangPosixName)( const tidyLocaleMapItemImpl *item );
+ctmbstr TY_(TidyLangPosixName)( const tidyLocaleMapItemImpl *item );
/**
* Initializes the TidyIterator to point to the first item
diff --git a/src/tidylib.c b/src/tidylib.c
index 31754ab..823ec3b 100644
--- a/src/tidylib.c
+++ b/src/tidylib.c
@@ -2644,13 +2644,13 @@ const tidyLocaleMapItem* TIDY_CALL getNextWindowsLanguage( TidyIterator* iter )
}
-const ctmbstr TIDY_CALL TidyLangWindowsName( const tidyLocaleMapItem *item )
+ctmbstr TIDY_CALL TidyLangWindowsName( const tidyLocaleMapItem *item )
{
return TY_(TidyLangWindowsName)( (tidyLocaleMapItemImpl*)(item) );
}
-const ctmbstr TIDY_CALL TidyLangPosixName( const tidyLocaleMapItem *item )
+ctmbstr TIDY_CALL TidyLangPosixName( const tidyLocaleMapItem *item )
{
return TY_(TidyLangPosixName)( (tidyLocaleMapItemImpl*)(item) );
} Hopefully someone will patch and test, and report - it compiles fine in WIN32.X64 - but need others to confirm... Then maybe the additional fixes could be added to the PR, or a separate simultaneous PR... thanks... |
I use Clang to compile and turn all warnings to errors. Clang has more strict syntax checking than GCC. |
Try |
@drizt WOW. adding And there are about 160 lines in my log, with the The question becomes should we be worried about most of these? One very common, is like On the other hand, in the specific case you mention, it does seem wrong to repeat the Look forward to further feedback on all the other warnings that the Now, the above patch could be included in your PR #747, if you get the chance, and really appreciate the help, especially with or I could merge, and add the others later... Now that I have seen more on this issue, will try to get to at least this |
Ok. I improve my PR when I get enough free time. |
@drizt while there still remains some warnings with Had to also make some fixes in the matching Thanks for the issue and PR... |
My application produce such errors with tidy
In this line
TIDY_EXPORT const ctmbstr TIDY_CALL TidyLangWindowsName( const tidyLocaleMapItem *item );
ctmbstr
has allready defined asconst
so no need to add extraconst
to function declaration. The same for another line.The text was updated successfully, but these errors were encountered: