On 18/10/13 16:42, Brad King wrote:
> +    if("x${arg}" MATCHES "^x(BUILTIN_TYPES_ONLY)$" AND "x${doing}" MATCHES 
> "^x$")
> 
> Generally the convention in similar state machines elsewhere
> is to not allow a keyword to be a value for a preceding keyword,
> so you don't need the AND here.
[...]
> So the block can be (untested):
> 
>  if("x${arg}" STREQUAL "xBUILTIN_TYPES_ONLY")
>    set(_CHECK_TYPE_SIZE_${arg} 1)
>    unset(doing)


This will cause

  check_type_size(int SIZEOF_INT LANGUAGE BUILTIN_TYPES_ONLY)

to be accepted by this state, while in my opinion it should report an
error. The state will change from doing=LANGUAGE to doing=unset without
setting the language, therefore C will be used and no error/warning is
shown to the user.

  AND "x${doing}" MATCHES "^x$"

was checking exactly this, in order to accept the keyword as value for
LANGUAGE and then show an unknown language "BUILTIN_TYPES_ONLY" error.

Should I just accept it and consider this correct?


Cheers,
 Daniele
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to